The methods provided by most articles on the Internet are ineffective and can kill individuals. The method in this article has been personally tested by the editor and is effective. It is recommended to use method two:
Method 1:
if ($("#checkbox-id")get(0).checked) {
// do something
}
Method 2:
if($('#checkbox-id').is(':checked')) {
// do something
}
Method 3:
if ($('#checkbox-id').attr('checked')) {
// do something
}