jquery 判断checkbox是否选中

方法一:
if ($("#checkbox-id")get(0).checked) {
    // do something
}

方法二:
if($('#checkbox-id').is(':checked')) {
    // do something
}

方法三:
if ($('#checkbox-id').attr('checked')) {
    // do something
}

猜你喜欢

转载自cainiao1923.iteye.com/blog/2288156