SO - 20246920
by Arun P Johny
HTML
<a href="" onClick="return false">
<div class='parentclass'>
Parent 1
<div style="display:none" class="childclass">child1</div>
</div>
</a>
<a href="" onClick="return false">
<div class='parentclass'>
Parent 2
<div style="display:none" class="childclass">child2</div>
</div>
</a>
JavaScript
$('.parentclass').click(function (e) {
var chtml = $(this).find('.childclass').html()
alert(chtml);
});
$('.childclass').click(function (e) {
e.stopPropagation()
e.preventDefault()
});