1. :enabled 匹配所有可用元素 2. :disabled 匹配所有不可用元素 3. :checked 匹配所有选中的被选中元素(复选框、单选框等,select中的option) 4. :selected 匹配所有选中的option元素
$("input:enabled")
[ <input name="id" /> ]
<form> <input name="email" disabled="disabled" /> <input name="id" /> </form>
$("input:disabled")
[ <input name="email" disabled="disabled" /> ]
$("input:checked")
[<input type="checkbox" id="Checkbox1" value="532250" name="userflag" checked="checked">, <input type="checkbox" id="Checkbox5" value="531941" name="userflag" checked="checked"> ]
<table class="table table-page" id="grid"> <tbody> <tr> <td><input type="checkbox" id="Checkbox1" value="532250" name="userflag" checked="checked"></td> <td>532250</td> </tr> <tr> <td><input type="checkbox" id="Checkbox3" value="532249" name="userflag"></td> <td>532249</td> </tr> <tr> <td><input type="checkbox" id="Checkbox5" value="531941" name="userflag" checked="checked"></td> <td>531941</td> </tr> <tr> <td><input type="checkbox" id="Checkbox21" value="531665" name="userflag"></td> <td>531665</td> </tr> <tr> <td><input type="checkbox" id="Checkbox23" value="531657" name="userflag"></td> <td>531657</td> </tr> </tbody> </table>
$("select option:selected")
[ <option value="2" selected="selected">Gardens</option> ]
<select> <option value="1">Flowers</option> <option value="2" selected="selected">Gardens</option> <option value="3">Trees</option> </select>