Why is this not working. I'm getting an empty array.
<select id="test">
<option value="Bar">Foo</option>
<option value="Bar1">Foo1</option>
<option value="">Foo2</option>
<option value="Bar3">Foo3</option&g开发者_运维技巧t;
<option value="Bar4" selected>Foo4</option>
<option value="Bar5">Foo5</option>
</select>
$('#test').find('option').filter(function() {
this.selected && this.value.length
}).get();
You need to return
your condition.
精彩评论