0
点赞
收藏
分享

微信扫一扫

通过原生js动态给元素添加选择器

爱动漫建模 2022-05-30 阅读 66

 

添加:

节点.classList.add("类名");


例如:
li.classList.add('active');

 

删除:

节点.classList.remove("类名");


例如:
li.classList.remove('active');

 


举报

相关推荐

0 条评论