asp.net.ph

Skip Navigation LinksHome > Abakada: Back to Basics > Language References > HTML Element Attributes > CHECKED Attribute

checked Attribute


Sets or retrieves whether the given check box or radio button is selected.

Applies To: INPUT

Syntax

Inline <element checked ... >
Script input.checked = false | true

Possible Values

false The control is not selected.
true The control is selected.

This attribute returns or accepts only a boolean value, meaning true if set, and false if not. The property is read/write with a default value of false.

Remarks

Checkboxes and radio buttons that are not selected do not return their values when the form is submitted.

Example

The following examples demonstrate how to retrieve the checked property and trigger an action if the property is set.

Run Sample | View Source
Run Sample | View Source

The following example demonstrates use of the CSS :checked pseudo-class to set styles for elements in a checked or selected state.

 Show me 

Applies To

INPUT type=checkbox, INPUT type=radio

See Also


Need a break ?
Suggested Reading

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph.

If you have any question, comment or suggestion,
please send us a note