方法一:
if ($("#checkbox-id").get(0).checked) {
//do something
}
方法二:
if($('#checkbox-id').is(':checked')) {
//do something
}
方法三:
if ($('#checkbox-id').attr('checked')) {
//do something
}
<!doctype html><htmllang="en"><head><metacharset="UTF-8" /><scripttype="text/javascript"src="js/jquery-2.2.2.min.js"></script><title>Document</title><scripttype="text/javascript">
$(function() {
$("#button").click(function() {
var h = $("input[type='checkbox']").length;
var s = '';
for (var i = 0; i < h; i++) {