ZVON > References > DOM2 Reference

checked (attribute )

Owning interface and usage:  
HTMLInputElement.checked

Member of these other interfaces:  
none

Readonly:   no

Type:   Boolean

Description:  
When the type attribute of the element has the value "radio" or "checkbox", this represents the current state of the form control, in an interactive user agent. Changes to this attribute change the state of the form control, but do not change the value of the HTML checked attribute of the INPUT element.

Note:  
During the handling of a click event on an input element with a type attribute that has the value "radio" or "checkbox", some implementations may change the value of this property before the event is being dispatched in the document. If the default action of the event is canceled, the value of the property may be changed back to its original value. This means that the value of this property during the handling of click events is implementation dependent.


Example:
Source:
   <INPUT id="textInput" type="checkbox" value=""></INPUT> <i>(Check this, if you want :-)</i>
JavaScript:
  function showCheckStatusOfCheckbox() {
    var main = document.getElementById('textInput');
    alert( main.checked );
  }
Try it:  
See it:
(Check this, if you want :-)