I’m trying to come up with a selector that will select all textarea elements, except those that are descendents of the .noSpell class.
So I want this to match:
<div>
<textarea />
</div>
but not this
<div class="noSpell">
<div>
<textarea />
</div>
</div>
I tried this:
$(":not(.noSpell) textarea")
but it didn’t work, presumably because while it won’t match the outer element, it can match any of the inner ones.
So, how would I write a selector that excludes parts of the DOM tree based on a class name?
How about this:
All textareas, then remove the ones that have a parent of
.noSpell.