Find out if the checkbox is checked by default:
The result of x will be:
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.
The defaultChecked property is supported in all major browsers.
Type | Description |
---|---|
Boolean | Returns true if the checkbox is checked by default, otherwise it returns false. |