Checkbox checked Property
Checkbox Object
Definition and Usage
The checked property sets or returns the checked state of a checkbox.
Syntax
Set the checked property:
checkboxObject.checked=true|false
Return the checked property:
Browser Support

The checked property is supported in all major browsers.
Example
Example
Set the checked state of a checkbox:
<html>
<head>
<script>
function check()
{
document.getElementById("check1").checked=true
}
function uncheck()
{
document.getElementById("check1").checked=false
}
</script>
</head>
<body>
<form>
<input type="checkbox" id="check1">Do you like summer?
</form>
<button onclick="check()">Check Checkbox</button>
<button onclick="uncheck()">Uncheck Checkbox</button>
</body>
</html>
Try it yourself »
More Examples
Checkbox - Convert text to uppercase
Several checkboxes in a form
Checkbox Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]