6
【笔记】DOM元素添加Class属性值
source link: https://feiju12138.github.io/2022/07/22/DOM%E5%85%83%E7%B4%A0%E6%B7%BB%E5%8A%A0Class%E5%B1%9E%E6%80%A7%E5%80%BC/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
【笔记】DOM元素添加Class属性值
2022-07-22
1
DOM元素添加Class属性值
添加一个Class属性值
// 创建一个DOM元素,也可以是获取的
let div = document.createElement("div");
// 添加一个Class属性值
div.classList.add("");
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK