// Selecting the element var btn = document.getElementById("myBtn"); // Setting new attributes btn.setAttribute("class", "click-btn"); btn.setAttribute("disabled", "");