I’m looking for a JQuery Selector which select all img elements which are not wrapped by a specific div (with class .special or .dontSelect)
For example my html code:
<div class="special">
<ul>
<li>
<img id="1"></img>
</li>
</ul>
</div>
<div>
....
<img id="2"></img>
....
<div class="dontSelect">
<img id="3"></img>
</div>
</div>
In this example only the img with id 2 should be selected, because 1 and 3 are “wrapped”.
Thanks for help
You can use the
filtermethod: