Answers for "vanilla js add attribute to element"

14

set attribute javascript

Element.setAttribute(name, value);
Posted by: Guest on March-02-2020
12

setAttribute()

element.setAttribute(name, value);
element.setAttribute("style", "background-color: red;");
Posted by: Guest on April-19-2020

Code answers related to "vanilla js add attribute to element"

Code answers related to "Javascript"

Browse Popular Code Answers by Language