JavaScript Agregar atributo
var element = document.getElementById('btnBuild');
element.setAttribute("disabled", "disabled");
Ganz404
var element = document.getElementById('btnBuild');
element.setAttribute("disabled", "disabled");
// Selecting the element
var btn = document.getElementById("myBtn");
// Setting new attributes
btn.setAttribute("class", "click-btn");
btn.setAttribute("disabled", "");
element.setAttribute(name, value);
element.setAttribute("style", "background-color: red;");
document.getElementsByTagName("H1")[0].setAttribute("class", "democlass");
Element.setAttribute(name, value);
// Here's what you do for the style attribute
span.setAttribute("style", "width:110%;float:center;left-margin:-10px;top-margin:-10;");