码迷,mamicode.com
首页 > Web开发 > 详细

JS——样式类的添加

时间:2017-11-22 13:11:42      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:color   空格   span   nbsp   this   col   his   样式   style   

1、注意current前有个空格

this.className = this.className + " current";

2、直接将class所有的值替换成current

this.className = "current";

 

JS——样式类的添加

标签:color   空格   span   nbsp   this   col   his   样式   style   

原文地址:http://www.cnblogs.com/wuqiuxue/p/7878343.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!