开发者

checkbox properties using jquery

<input type="checkbox" id="var1" name="s_k" >
<input type="checkbox" id="var2" name="s_k">
<input type="checkbox" id="var3" name="s_k">

At some point the checkbox id=var1 is selected and disabled after a certain operation.Now then if id var2 and var3 checkbox are selected how to get the newly selected box id i.e, get ids of checkboxes开发者_如何学运维 which is not disabled using jquery


i.e, get ids of checkboxes which is not disabled using jquery

I'm assuming your question is "how can I do that thing I just said?", in which case, you can combine the :not and :disabled selectors:

// Get all checkboxes that aren't disabled:
$('input[type="checkbox"]:not(:disabled)')

// Get all selected checkboxes that aren't disabled:
$('input[type="checkbox"]:checked:not(:disabled)')
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜