Question #55   Submitted by Answiki on 06/06/2020 at 03:52:29 PM UTC

How to check / uncheck a checkbox input in vanilla JS ?

Answer   Submitted by Answiki on 02/22/2022 at 10:39:27 AM UTC

To check or uncheck a checkbox or a radio button, use the checked property of the concerned element by assigning a boolean value (true or false) :


To check:

document.getElementById("myCheckbox").checked = true;
To uncheck:

document.getElementById("myCheckbox").checked = false;

9 events in history
Answer by Answiki on 02/22/2022 at 10:39:27 AM

To check or uncheck a checkbox or a radio button, use the checked property of the concerned element by assigning a boolean value (true or false) :


To check:

document.getElementById("myCheckbox").checked = true;
To uncheck:

document.getElementById("myCheckbox").checked = false;

Answer by Answiki on 02/22/2022 at 10:36:24 AM

To check or uncheck a checkbox or a radio button, use the checked property:


To check:

document.getElementById("myCheckbox").checked = true;
To uncheck:

document.getElementById("myCheckbox").checked = false;

Question by Answiki 06/06/2020 at 03:55:08 PM
How to check / uncheck a radio button input in JavaScript?
Question by Answiki 06/06/2020 at 03:55:01 PM
How to check / uncheck a radio button input in pure JavaScript?
Question by Answiki 06/06/2020 at 03:54:50 PM
How to check / uncheck a radio button input in vanilla JS ?
Question by Answiki 06/06/2020 at 03:52:29 PM
How to check / uncheck a checkbox input in vanilla JS ?
Question by Answiki 06/06/2020 at 03:52:19 PM
How to check / uncheck a checkbox input in pure JavaScript ?
Answer by Answiki on 06/06/2020 at 03:52:06 PM

To check or uncheck a checkbox or a radio button, use the checked property:


To check:

document.getElementById("myCheckbox").checked = true;
To uncheck:

document.getElementById("myCheckbox").checked = false;



Question by Answiki 06/06/2020 at 03:49:00 PM
How to check / uncheck a checkbox input in JavaScript ?
# ID Query URL Count

Icons proudly provided by Friconix.