How to get the tag name of an element using JavaScript?
Originally posted here!
To get the tag name of a DOM element in JavaScript, you can use the
tagName
property in the element in JavaScript.
Consider this article tag with some content inside it,
<article id="myArticleSection">
Lorem ipsum dolor si...
melvingeorge-me.hashnode.dev2 min read