im searching for the Element whicht Provides the Name of a Parent. This:
$('.Item').click(function(){
var a = $(this).parent();
alert(a[0].tagName);
});
just says "DIV", but I need the real name of a Element. Thanks
Try the following (Alerts the tag name, and then the Real Name) :
I used $(a[0]).attr('name');
e.g.
$('.Item').click(function() {
var a = $(this).parent();
alert(a[0].nodeName.toLowerCase()); //Tag Name
alert($(a[0]).attr('name')); //Attribute (real) name
//OR
alert(a.attr('name')); //Attribute (real) name
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With