开发者

Jquery filter giving empty results

开发者 https://www.devze.com 2023-02-09 04:10 出处:网络
Why is this not working. I\'m getting an empty array. <select id=\"test\"> <option value=\"Bar\">Foo</option>

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消