checked property

[This documentation is preliminary and is subject to change.]

Sets or retrieves the state of the check box or radio button.

HTML 4.01 Specification, Section 17.4

Syntax

HRESULT value = object.put_checked(VARIANT_BOOL v);HRESULT value = object.get_checked(VARIANT_BOOL* p);

Property values

Type: VARIANT_BOOL

false

Default. Control is not selected.

true

Control is selected.

Standards information

Remarks

Check boxes that are not selected do not return their values when the form is submitted.

A user can select a radio button only if the button has a IHTMLInputElement::name. To clear a selected radio button, a user must select another button in the set.

Windows Internet Explorer 8 and later. In IE8 Standards mode, parsing operations on the IHTMLInputElement::checked content attribute always affect both the IHTMLInputElement::checked content attribute and IHTMLInputElement::defaultChecked Document Object Model (DOM) attribute. For example, IHTMLEventObj2::removeAttribute sets both IHTMLInputElement::checked and IHTMLInputElement::defaultChecked to VARIANT_FALSE. Similarly, IHTMLElement::setAttribute sets both DOM attributes to VARIANT_TRUE (as if the element was being re-parsed) For more information on IE8 mode, see Defining Document Compatibility.

Internet Explorer 8 and later. In IE8 mode, the IHTMLInputElement::defaultChecked DOM attribute reflects the value of the IHTMLInputElement::checked content attribute.

See also

Reference

IHTMLInputElement::defaultChecked

Conceptual

Introduction to Forms

 

 

Build date: 6/12/2012