What is jquery opposite of this: not () command

I am trying to get all parameter values ​​that don't have attribute value. So I want it to retrieve parameters like <option value></option> .

I have $('#advancedSearchWrap option:not([value=""])') , but I need the other way around. What is the opposite of this: not () command?

+7
source share
4 answers

Just use a regular CSS attribute selector:

 $('#advancedSearchWrap option[value=""]'); 
+13
source

If instead you did not want to, you could use filter()

+12
source

Isn't that a minus: not a selector? remove it from your expression and it should work.

+3
source

This also works.

 $morphemes.not('[data-width]'); $morphemes.not(':not([data-width])'); //Double Negative logic, derp derp. 
+3
source

All Articles