THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Input Checkbox defaultChecked Property

Input Checkbox Object Reference Input Checkbox Object

Example

Find out if the checkbox is checked by default:

var x = document.getElementById("myCheck").defaultChecked;

The result of x will be:

true
Try it yourself »

Definition and Usage

The defaultChecked property returns the default value of the checked attribute.

This property returns true if the checkbox is checked by default, otherwise it returns false.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The defaultChecked property is supported in all major browsers.


Syntax

checkboxObject.defaultChecked

Return Value

Type Description
Boolean Returns true if the checkbox is checked by default, otherwise it returns false.

Input Checkbox Object Reference Input Checkbox Object