JS——样式类的添加

1、注意current前有个空格

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

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

this.className = "current";

 

posted @ 2017-11-22 11:25  var_obj  阅读(1118)  评论(0编辑  收藏  举报