Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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", "");
 
PREVIOUS NEXT
Tagged: #add #attribute #selected #element #javascript
ADD COMMENT
Topic
Name
1+1 =