开发者

checkbox properties using jquery

开发者 https://www.devze.com 2023-01-14 12:10 出处:网络
<input type=\"checkbox\" id=\"var1\" name=\"s_k\" > <input type=\"checkbox\" id=\"var2\" name=\"s_k\">
<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

精彩评论

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

关注公众号