Answers for "how to set attribute for an element created in javascript"

0

how to add attribute to selected element in javascript

// Selecting the element
    var btn = document.getElementById("myBtn");
	
    // Setting new attributes
    btn.setAttribute("class", "click-btn");
    btn.setAttribute("disabled", "");
Posted by: Guest on June-03-2020
2

set property dom javascrpt

document.getElementsByTagName("H1")[0].setAttribute("class", "democlass");
Posted by: Guest on April-17-2020

Code answers related to "how to set attribute for an element created in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language