amanda chaw
amanda chaw

Reputation: 137

get jquery ui multiselect unchecked value

I have a jquery UI multiselect dropdown. Here is the link I want to get unchecked value. I have something like this for getting all selected options:

var optionValues = $('option:selected', this).map(function() {

                        return this.value;

                }).get();

But I want unchecked value. Any idea?

Upvotes: 0

Views: 656

Answers (1)

Kartikeya Khosla
Kartikeya Khosla

Reputation: 18873

Try this :-

var notSelectedValues = $("select#id").find('option').not(':selected');
var array = notSelectedValues.map(function () {
    return this.value;
}).get();
alert(array.join(', '))

Fiddle Demo

Upvotes: 1

Related Questions