Different actions for the embedded and the containing element
I have an anchor in a table. I would need an action for the click on the anchor, and another for the开发者_StackOverflow中文版 click on the table ('s cell). But if I click on the anchor, both of the actions will be run off. How can I disable the table's action when I click on the anchor?
Thank you!
try this:
$('anchor').bind('click', function(ev) {
ev.stopPropagation();
//... your code
return false;
});
精彩评论