set class and id attributes for a div javascript code example
Example: javascript change attribute
var element = document.getElementById("elemId");
element.setAttribute("attributeName", "value");
var element = document.getElementById("elemId");
element.setAttribute("attributeName", "value");