Answers for "javascript attribute value set"

13

set attribute javascript

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

GET and SET the attribute of an element

const link = document.querySelector('a');
console.log(link.getAttribute('href'));
link.setAttribute('href', 'https://www.yahoo.com');
link.innerText='Yahoo';
Posted by: Guest on December-11-2021

Code answers related to "javascript attribute value set"

Code answers related to "Javascript"

Browse Popular Code Answers by Language