// Selecting the element var btn = document.getElementById("myBtn"); // Setting new attributes btn.setAttribute("class", "click-btn"); btn.setAttribute("disabled", "");
// thats how we set attribute. document.getElementsByTagName("H1")[0].setAttribute("class", "democlass");
// Here's what you do for the style attribute span.setAttribute("style", "width:110%;float:center;left-margin:-10px;top-margin:-10;");
document.getElementsByTagName("H1")[0].setAttribute("class", "democlass");