📜  未捕获(承诺中)DOMException:无法在“DOMTokenList”上执行“添加”:提供的令牌(“警报警报危险”)包含 HTML 空格字符,这些字符在令牌中无效. - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:31.892000             🧑  作者: Mango

代码示例1
//Well, class names cannot contain spaces, because the space separates multiple class names from each other. For example, if your HTML contains

class="zocial button"
//it means that this element has two classes, "zocial" and "button".
//If you want to add both of these classes, you have to pass each one as argument to the method:

buttonz[i].classList.add('zocial', 'button');