Trying to do some administration backend things,
I have a tr line containing action links.
<tr>
<td>
<span>item1</span>
</td>
<td>
<a href="#">delete</a>
</td>
</tr>
When a user clicks on the tr line, it should select it (and a handler is bound to that event, so I can display extra informations somewhere else), AND when a user clicks on the delete link, another handler should be called to delete the item.
Setting the click event for both targets, like this :
$("tr").click(function(e){
// show line infos, by reloading the page
});
$("tr a").click(function(e){
// delete item
});
When I click on the delete link, it appears that the tr event is always called first, and since my tr's handler reload the page the link's handler is never called. that's normal because bubbling system will call my handlers in this order :
down phase : tr a
up phase : a tr
How can I skip the first tr's handler in down phase ?
I tried a few things with e.preventDefault(), e.stopPropagation() without success.