What you have should work fine. That's exactly how you use stopPropagation
.
Here is an example to show how it stops the event from bubbling:
HTML:
<table>
<tr>
<td>
<p>inside paragraph</p> outside paragraph
</td>
</tr>
</table>
Javascript:
$(function(){
$('td').click(function(event){
alert('cell');
});
$('td p').click(function(event){
event.stopPropagation();
alert('paragraph');
});
});
Demo: http://jsfiddle.net/39n5X/
If you click on "inside paragraph" it will only show the "paragraph" message, and if you click on "outside paragraph" it will show the "cell" message instead.