Answers for "js check attribute"

4

how to check element has an attribute js

let result = element.hasAttribute(name);
Posted by: Guest on July-28-2020
2

js getattribute

const link = document.querySelector('a');

console.log(link.getAttribute('href'));
Posted by: Guest on July-19-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language