inside have other child divs. have child divs too.
<div class="parent"> <div class="child_1">//children elements</div> <div class="child_1">//children elements</div> <div class="child_1">//children elements</div> <div class="child_1">//children elements</div> </div>
i want add click event fires when click element inside parent div, including parent div, excluding child_1 div , descendants.
currently tried
jquery(".parent").not(".child_1").click(function(event) { });
but click event works when click on child_1 div , it's descendants.
what problem here? please help.
update
here have click event child_1
jquery(".child_1").click(function(event) { });
you should this.
$('.parent').on('click', function () { // stuff here }).find('.child_1').on('click', function (e) { e.stoppropagation(); });
here fiddle http://jsfiddle.net/bbx7d/1/
Comments
Post a Comment