I m trying to come up with a selector that will select all textarea
elements, except those that are descendents of the .noSpell
class.
因此,我希望这样做:
<div>
<textarea />
</div>
而不是
<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?