在html5中增長了classListhtml
document.getElementById("button").classList.add(「active」);html5
document.getElementById("button").classList.remove("active");spa