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

📅  最后修改于: 2022-03-11 15:02:30.511000             🧑  作者: 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");