Javascript & Ajax

Change HTML class attribute using javascript

To change an element’s class attribute using javascript do the following:

document.getElementById("id").setAttribute("class", "myclassname");

or

document.getElementById("id").className = "myclassname";