I have an image inside a div, when I click on the image, I want it to warn me about the parent id, which will be "group1"
<div id="group1">
<img class="header_logo_dis" src="test.png">
</div>
$('.header_logo_dis').click(function() {
alert($(this).parent("div:first"));
});
Thank,
source
share