Iori
Iori

Reputation: 660

attribute selector issue

I'm applying a class on all the select boxes.

$('select[class!="skip_these"]').uniform();

and the above code means when I apply to any select box with class skip_there it will not be applied and it works.

<select name="xyz" class="skip_these"></select>

But when I add another class it applies and I don't want that.

<select name="xyz" class="skip_these myclass"></select>

Is there a way to resolve it?
I don't want to change the plugin for this.

Can it be done by jQuery selector?

Upvotes: 3

Views: 123

Answers (2)

Blender
Blender

Reputation: 298532

Use the :not pseudo-selector:

$('select:not(.skip_these)').uniform();

Upvotes: 6

karaxuna
karaxuna

Reputation: 26940

$('select:not(.skip_these)').uniform();

This will work too:

 $('select').not('.skip_these').uniform();

Upvotes: 8

Related Questions