I have the following code
<div class="test-123">
<p>Some Text</p>
<div class="delete"></div>
<div class="edit"></div>
</div>
The problem is that I have to have onclick jquery handlers for the three elements ( test-123, delete and edit ). I face the following problem. When I click on delete the onclick handler of test-123 is also executed after the onclick handler of the delete is finshed.
Is there a way to somehow prevent that?
You are looking for
stopPropogationhttp://api.jquery.com/event.stopPropagation/
Comment out the
e.stopPropagationline and see what happens.Working demo : http://jsfiddle.net/Pjn3s/2/