Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript setattribute

element.setAttribute(<name>, <value>);
// ex
var aElement = document.querySelector("a"); 
aElement.setAttribute("href", "https://isitchristmas.com/"); 
// same as <a href="https://isitchristmas.com/"></a>
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #setattribute
ADD COMMENT
Topic
Name
6+1 =