What is the best way to get an element's tag name in JS?
- by webdestroya
I want to get the name of a certain tag (to tell whether it is a div/input/span/p/so on)
I found that there are 3 different attributes that give me the tag name:
tagName, nodeName, and localName
My question is: Which one is the most supported in all browsers? And/or is there a method to get the tag name in Prototype (I looked but couldn't find one)?