Answers for "dom create element attribute"

0

giving an html element own attribute using js

element.hasAttribute('foo');
element.getAttribute('foo');
element.setAttribute('foo', value);
element.removeAttribute('foo');
Posted by: Guest on December-08-2021
2

create an attribute for html with javascript

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

Code answers related to "Javascript"

Browse Popular Code Answers by Language