Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道我可以使用:checkbox:checked所有选中的复选框来获取您想要调用的列表或数组。
:checkbox:checked
但是有没有获得未检查列表的功能?(就像:checkbox:unchecked这似乎不是一个有效的功能)我不想循环使用每个元素.is(":checked")。
:checkbox:unchecked
.is(":checked")
谢谢。
试试这个
$(':checkbox:not(:checked)')
你可以试试这个选择器,
var unchecked_checkboxes = $(".checkbox").not(":checked");
我假设您的复选框具有“复选框”类。