10
09/2014
jquery attr tagName
tagName is a property of the underlying DOM element, not an attribute, so you can use prop, which is the jQuery method for accessing/modifying properties:
alert($(obj).prop('tagName'));
Better, however, is to directly access the DOM property:
alert(obj[0].tagName);
Or
alert(obj.get(0).nodeName);