I\'m trying to get the name of an element in Javascript. Meaning if the element is , then \"div\" would be returned. If it\'s &l
\"div\"
&l
Use nodeName (see this note about tagName):
"My advice is not to use tagName at all. nodeName contains all functionalities of tagName, plus a few more. Therefore nodeName is always the better choice."