JS——样式类的添加 1、注意current前有个空格 this.className = this.className + " current"; 2、直接将class所有的值替换成current this.className = "current";