org.w3c.dom.html2

Interface HTMLOptionElement

public interface HTMLOptionElement extends HTMLElement

A selectable choice. See the OPTION element definition in HTML 4.01.

See also the Document Object Model (DOM) Level 2 HTML Specification.

Method Summary
booleangetDefaultSelected()
Represents the value of the HTML selected attribute.
booleangetDisabled()
The control is unavailable in this context.
HTMLFormElementgetForm()
Returns the FORM element containing this control.
intgetIndex()
The index of this OPTION in its parent SELECT , starting from 0.
StringgetLabel()
Option label for use in hierarchical menus.
booleangetSelected()
Represents the current state of the corresponding form control, in an interactive user agent.
StringgetText()
The text contained within the option element.
StringgetValue()
The current form control value.
voidsetDefaultSelected(boolean defaultSelected)
Represents the value of the HTML selected attribute.
voidsetDisabled(boolean disabled)
The control is unavailable in this context.
voidsetLabel(String label)
Option label for use in hierarchical menus.
voidsetSelected(boolean selected)
Represents the current state of the corresponding form control, in an interactive user agent.
voidsetValue(String value)
The current form control value.

Method Detail

getDefaultSelected

public boolean getDefaultSelected()
Represents the value of the HTML selected attribute. The value of this attribute does not change if the state of the corresponding form control, in an interactive user agent, changes. See the selected attribute definition in HTML 4.01.

getDisabled

public boolean getDisabled()
The control is unavailable in this context. See the disabled attribute definition in HTML 4.01.

getForm

public HTMLFormElement getForm()
Returns the FORM element containing this control. Returns null if this control is not within the context of a form.

getIndex

public int getIndex()
The index of this OPTION in its parent SELECT , starting from 0.

getLabel

public String getLabel()
Option label for use in hierarchical menus. See the label attribute definition in HTML 4.01.

getSelected

public boolean getSelected()
Represents the current state of the corresponding form control, in an interactive user agent. Changing this attribute changes the state of the form control, but does not change the value of the HTML selected attribute of the element.

getText

public String getText()
The text contained within the option element.

getValue

public String getValue()
The current form control value. See the value attribute definition in HTML 4.01.

setDefaultSelected

public void setDefaultSelected(boolean defaultSelected)
Represents the value of the HTML selected attribute. The value of this attribute does not change if the state of the corresponding form control, in an interactive user agent, changes. See the selected attribute definition in HTML 4.01.

setDisabled

public void setDisabled(boolean disabled)
The control is unavailable in this context. See the disabled attribute definition in HTML 4.01.

setLabel

public void setLabel(String label)
Option label for use in hierarchical menus. See the label attribute definition in HTML 4.01.

setSelected

public void setSelected(boolean selected)
Represents the current state of the corresponding form control, in an interactive user agent. Changing this attribute changes the state of the form control, but does not change the value of the HTML selected attribute of the element.

setValue

public void setValue(String value)
The current form control value. See the value attribute definition in HTML 4.01.