jquery、js判断复选框是否选中

js:

if (document.getElementById("checkboxID").checked) {
  alert("checkobx is checked");
} 

jquery:

if ($("#checkboxID").prop("checked")) {
  alert("checkbox is checked");
}

if ($("#checkboxID").is(":checked")) {
  alert("checkbox is checked");
}

原文地址:https://www.cnblogs.com/loveyunk/p/6444383.html