JQuery invert table selection
- by Lars Tackmann
I have page part like this
<div id="inbox">
<h1>Headline</h1>
<p>First paragraph</p>
<table>
<tbody>
<tr>
<td>table stuff</td>
</tr>
</tbody>
</table>
<p>Second paragraph</p>
</div>
I want to assign a handler to everything within the #inbox div that is not a part (a child) of the table. I tried to do something like
$('#inbox:not(:has(table))').click(function(){
alert('hello inbox');
});
But that does not work, so how do I invert the selection of the table inside the #inbox ?