I would like to get all form elements that don't have a specific CSS class. Example:
<form>
<div>
<input type="text" class="good"/>
<input type="text" class="good"/>
<input type="text" class="bad"/>
</div>
</form>
What selector should I use to select all elements that don't have 'bad' css class?
Thank you.
You can use the not() filter:
$("input").not(".bad")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With