Name
CHECKED — NN 4 IE 3 HTML 4
Synopsis
CHECKED
Optional
A Boolean attribute that designates whether the current checkbox or
radio INPUT
element is turned on when the page
loads. In the case of a radio button grouping, only one
INPUT
element should have the
CHECKED
attribute. Scripts can modify the internal
value of this attribute after the page has loaded. When the form is
submitted, an INPUT
element whose
CHECKED
attribute is turned on sends its
name/value pair as part of the form data. The name/value pair
consists of values assigned to the NAME
and
VALUE
attributes for the element. If no value is
assigned to the VALUE
attribute, the string value
"active"
is automatically assigned when the
checkbox or radio button is highlighted. This is fine for checkboxes
because each one should be uniquely named. However, all radio buttons
in a related group must have the same name, so this default behavior
doesn’t provide enough information for most server-side
programs to work with.
Input Types
checkbox
, radio
Example
<INPUT TYPE="checkbox" NAME="addToList" CHECKED>Send email updates to this web site.
Value
The presence of this attribute turns on its property.
Default
Off.
Object Model Reference
- NN
[window.]document.formName.inputName.checked
[window.]document.forms[i].elements[i].checked
- IE
[window.]document.formName.inputName.checked
[window.]document.forms[i].elements[i].checked
[window.]document.all.elementID.checked
Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.