Dim*_*kiy 10 jquery jquery-selectors
我有一堆带有数值的文本输入:
<input type='text' value='25' />
<input type='text' value='0' />
<input type='text' value='45' />
<input type='text' value='-2' />
.
. etc...
Run Code Online (Sandbox Code Playgroud)
我只需要选择值大于0的那些输入.我怎么能用jQuery做到这一点?
Bol*_*ock 20
这样的东西,使用.filter():
$('input[type="text"]').filter(function() {
return parseInt($(this).val(), 10) > 0;
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11911 次 |
| 最近记录: |