Javascript How to change class name of an HTML element – javascript March 9, 2011 Pramod T P Leave a comment You can change the class name using the below given code. document.getElementById(“idElement”).setAttribute(“class”,”className”);