I am trying to get a checkbox to check and uncheck if it isn't/is checked. It is checking if unchecked - but not unchecking if yes checked. Very strange. Thanks in advance!
Here's my code:
EDIT: Here's the jsfiddle: http://jsfiddle.net/itamark/UnR4X/
JS:
$(':checkbox').mouseenter(function(){
if($(this).not(':checked')) {
alert('notchecked');
$(this).attr('checked', true);
}
else if($(this).is(':checked')){
alert('ischecked');
$(this).attr('checked', false);
}
})
HTML:
<input type="checkbox" name"myCheck" id="chk1"/>Checkbox</label>