CSS and unbind problem

CSS and unbind problem

Hi,

I have a table tag within a div tag. I want to bind a click event to the div tag, but suppress the click event in the table tag.

Pseudo code:

<div id="foo">
   hello<table><tr><td>world</td></tr></table>
</div>

<script>
function myfunction() {
   alert('here');
}

$("#foo").bind('click', myfunction);
$("#foo table").unbind('click', myfunction);
</script>


This example does not work. Clicking the table text still calls myfunction()

Any help would be appreciated.[/code]