在html5中增加了classList
document.getElementById("button").classList.add(“active”);
document.getElementById("button").classList.remove("active");
在html5中增加了classList
document.getElementById("button").classList.add(“active”);
document.getElementById("button").classList.remove("active");
转载于:https://www.cnblogs.com/manong-xxf/p/11428168.html