I want to set checkbox checked
on document load, if check box value="1"
, and unchecked if value="0"
.
<input type="checkbox" value="1">
<input type="checkbox" value="0">
<input type="checkbox" value="1">
Jquery: which is wrong, tried many things
$(document).ready ('input[type="checkbox"]', function(event) {
if ($(this).val==1) {
$(this).is(":checked")
}
});