I have a checkbox that is always checked, but based on user input elsewhere in my form (I have it onChange="functionName"in the selection window). I would like to take it off.
onChange="functionName"
How to do it?
$('#mycheckbox').attr('checked', false)
do i need to do this with jQuery? what about javascript please try the following:
Check: document.getElementById("ckBox").checked = true;
document.getElementById("ckBox").checked = true;
UnCheck: document.getElementById("ckBox").checked = false;
document.getElementById("ckBox").checked = false;
plese .
, jquery 1.6
$(".mycheckbox").prop("checked", true/false)
:
$('input[name=foo]').attr('checked', true);
$('input[name=foo]').attr('checked', false);
.
checked .
checked
$("#yourSelect").change(function () { $("#yourCheckBox").removeAttr("checked"); });
I believe the easiest way is to call $('theCheckbox').click()
$('theCheckbox').click()
You can also use $('theCheckbox').checked = falseor$('theCheckbox').removeAttribute('checked')
$('theCheckbox').checked = false
$('theCheckbox').removeAttribute('checked')