HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Checkbox defaultChecked Property

Checkbox Object Reference 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.


Checkbox Object Reference Checkbox Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE