Select element except for specific child
<p>My problem is: </p>

<p>I select a div with many children and would like to know how to not select a certain element which is actually a child of that previously selected element. </p>

<p>I already tried the <code>:not(selectedElement)</code> selector and the <code>.not(selectedElement)</code> selector or api (dont know how it's called). Anyway, I also found someone who asked a similar question which didn't help so I guess the only way to find out what is wrong is to ask here if you have any approaches (I know stackoverflow is not meant to work like that but I seriously sat there many times and couldnt solve it):</p>

<p>HTML:</p>

<pre><code>&lt;div class="tablee" style="cursor:/*pointer*/;"&gt;
    &lt;table&gt;
        &lt;tbody&gt;
            &lt;tr&gt;
                &lt;td&gt;
                    &lt;a href="something.php"&gt;
                        &lt;img src="1.jpg"&gt;
                    &lt;/a&gt;
                &lt;/td&gt;
                &lt;td class="postcontent"&gt;
                    &lt;p class="postusername"&gt;
                        &lt;a class="poster" href="something.php"&gt;momo&lt;/a&gt;
                        &lt;br&gt;
                        some other text
                    &lt;/p&gt;
                &lt;/td&gt;
                &lt;td&gt;
                    &lt;imgsrc="1.jpg"&gt;
                &lt;/td&gt;
            &lt;/tr&gt;
        &lt;/tbody&gt;
    &lt;/table&gt;
&lt;/div&gt;
</code></pre>

<p>jQuery:</p>

<pre><code>//non-dynamyic
$(".tablee").not($(this).find('a')).click(function() {
    $(this).next().slideToggle();
});
</code></pre>

<p>So if <code>tablee</code> is clicked and not a link within it (within <code>tablee</code> element) the next element that comes after <code>tablee</code> shall toggle.</p>