What is the best way to get an element’s tag name in JS?
nodeName is the most consistent here. I would suggest you take a minute and read this post for a few differences and inconsistencies with tagName if you’re more curious as to why. For the prototype part of the question…it’s a JavaScript property, just this.nodeName should work or element.nodeName, whatever your element’s called in the current … Read more