IHTMLOptionButtonElement::checked Property

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

Syntax


HRESULT IHTMLOptionButtonElement::get_checked(VARIANT_BOOL *p);HRESULT IHTMLOptionButtonElement::put_checked(VARIANT_BOOL v);

Parameters

p
Pointer to a variable of type VARIANT_BOOL that receives one of the values listed in Possible Values.
v
VARIANT_BOOL that specifies one of the values listed in Possible Values.

Possible Values

false Default. Control is not selected.
true Control is selected.

Return Value

Returns S_OK if successful, or an error value otherwise.

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 IHTMLOptionButtonElement::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 IHTMLOptionButtonElement::checked content attribute always affect both the IHTMLOptionButtonElement::checked content attribute and IHTMLOptionButtonElement::defaultChecked  Document Object Model (DOM) attribute. For example, removeAttribute('checked') sets both IHTMLOptionButtonElement::checked and IHTMLOptionButtonElement::defaultChecked to VARIANT_FALSE. Similarly, setAttribute('checked', 'checked') 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.

See Also

Community Additions

Show: