How to uncheck?

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.

How to do it?

+5
source share
6 answers

$('#mycheckbox').attr('checked', false)

+10
source

do i need to do this with jQuery? what about javascript please try the following:

Check: document.getElementById("ckBox").checked = true;

UnCheck: document.getElementById("ckBox").checked = false;

+18
source

plese .

, jquery 1.6

$(".mycheckbox").prop("checked", true/false)
+2

:

$('input[name=foo]').attr('checked', true);

:

$('input[name=foo]').attr('checked', false);

.

+1

checked .

$("#yourSelect").change(function () {
    $("#yourCheckBox").removeAttr("checked");
});
+1

I believe the easiest way is to call $('theCheckbox').click()

You can also use $('theCheckbox').checked = falseor$('theCheckbox').removeAttribute('checked')

-1
source

All Articles