Ayhan
Ayhan

Reputation: 183

Jquery selector: getting all select boxes except multiple ones

I am trying to select all select boxes but multiple select boxes in document. I tried:

$('select').not('[multiple]').hide();

How can I do this?

Edit:

Definition of a select box:

<select>
    <option></option>
</select>

Definition of a multiple select box:

<select multiple>
    <option></option>
    <option></option>
    <option></option>
</select>

Upvotes: 1

Views: 3665

Answers (1)

Ariel
Ariel

Reputation: 26753

Close:

$('select:not(select[multiple])').hide();

Or:

$('select').not('select[multiple]').hide();

Upvotes: 3

Related Questions