📌  相关文章
📜  javascript 添加类 - Javascript 代码示例

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

代码示例6
// This is to add a class to any html element after you store it
// in the element variable 

element.classList.add("my-class-name");

// This is to remove a class from the element

element.classlist.remove("my-class-name");