jQuery if checkbox is checked
jQuery if checkbox is checked
回答1
for jQuery 1.6 or higher:
if ($('input.checkbox_check').prop('checked')) {
//blah blah
}
the cross-browser-compatible way to determine if a checkbox is checked is to use the property https://api.jquery.com/prop/
评论
Note that "The .prop() method gets the property value for only the first element in the matched set." see api.jquery.com/prop
回答2
if ($('input.checkbox_check').is(':checked')) {
回答3
his $('#checkboxId').is(':checked') for verify if is checked
& this $("#checkboxId").prop('checked', true) to check
& this $("#checkboxId").prop('checked', false) to uncheck

浙公网安备 33010602011771号