Category: JavaScript Questions

How to Uncheck a Radio Button Using JavaScript

To uncheck a radio button in JavaScript, we make use of checked property.   Its value can be true or false.  Example is given below. <html> <head> <title>JavaScript Tutorial </title> <script type="text/javascript"> function Check() { //Check a radio button. document.getElementById("myRadio").checked = true; } function Uncheck() { //Uncheck a radio button. document.getElementById("myRadio").checked = false; } </script>

How to Check a Radio Button Using JavaScript

To check a radio button in JavaScript, we make use of checked property.   Its value can be true or false.  Example is given below. <html> <head> <title>JavaScript Tutorial </title> <script type="text/javascript"> function Check() { //Checking a radio buton. document.getElementById("myRadio").checked = true; } </script> </head> <body> My Radio Button: <input id="myRadio" type="radio" /> <input type="button"

How to Uncheck a Checkbox Using JavaScript

To uncheck a checkbox in JavaScript, we make use of checked property.   Its value can be true or false.  Example is given below. <html> <head> <title>JavaScript Tutorial </title> <script type="text/javascript"> function Check() { //Check a Checkbox. document.getElementById("myCheckbox").checked = true; } function Uncheck() { //Uncheck a Checkbox. document.getElementById("myCheckbox").checked = false; } </script> </head> <body> My

How to Uncheck All Checkboxes Using JavaScript

To uncheck all checkboxes in JavaScript, we have to create a custom function which will loop through all input elements and check if it is checkbox or not.  Example is given below. <html> <head> <title>JavaScript Tutorial </title> <script type="text/javascript"> function CheckAll() { //Get All Checkboxes. var allCheckboxes = document.getElementsByTagName('input'); //Check All Checkboxes. for(var i=0; i