How to get all the attributes of an element using JavaScript?
Originally posted here!
To get all the attributes of a DOM element, we can use the attributes property on the element using JavaScript.
Let's say we have a h1 tag with custom attributes data-color and data-maxlength like this,
<h1 data-color="red" d...
melvingeorge-me.hashnode.dev2 min read