tagName is a property of the underlying DOM element, not an attribute, so you can use prop , which is the jQuery property access / modification method:
alert($(obj).prop('tagName'));
It is better, however, to directly access the DOM property:
tagName is a native property of the DOM element, it is not part of jQuery itself. With that in mind, use $()[0] to get the DOM element from the jQuery selector, for example:
var obj = $("<div></div>"); alert(obj[0].tagName);