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 Checkbox:  <input id="myCheckbox" type="checkbox" />
<input type="button" value="Check" onclick="Check()"/>
<input type="button" value="Uncheck" onclick="Uncheck()"/>
 
</body>
</html>

 

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •