[英]Check if more than one checkbox is selected in jQuery
我需要知道是否從我的列表中選擇了多個復選框。
如何使用 jQuery 實現這一目標?
我已經嘗試過:checked
,但沒有成功。
謝謝大家的幫助!
假設您的容器將有一個 id
if ($("#containerID input:checkbox:checked").length > 1) {
// your code goes here
}
查看工作演示
var n = $("input:checked").length;
if (n >= 2)
...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.