Its probably simple but I am not able to do it. I want to find and select all elements of a class which are not contained under a given id.
For Example: Below here, how to find elements of class “me” outside id “con”
<div id="con">
<div class="me">hi1</div>
<div class="me">hi2</div>
</div>
<div class="me">hi3</div>
<div class="me">hi4</div>
Using
not()you can specify a selector that the elements should not match.http://jsfiddle.net/AufVD/
This could also be written as:
http://jsfiddle.net/AufVD/1/