public interface

HTMLSelectElement

implements HTMLElement
org.w3c.dom.html.HTMLSelectElement

Class Overview

The select element allows the selection of an option. The contained options can be directly accessed through the select element as a collection. See the SELECT element definition in HTML 4.0.

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

Summary

[Expand]
Inherited Constants
From interface org.w3c.dom.Node
Public Methods
abstract void add(HTMLElement element, HTMLElement before)
Add a new element to the collection of OPTION elements for this SELECT .
abstract void blur()
Removes keyboard focus from this element.
abstract void focus()
Gives keyboard focus to this element.
abstract boolean getDisabled()
The control is unavailable in this context.
abstract HTMLFormElement getForm()
Returns the FORM element containing this control.
abstract int getLength()
The number of options in this SELECT .
abstract boolean getMultiple()
If true, multiple OPTION elements may be selected in this SELECT .
abstract String getName()
Form control or object name when submitted with a form.
abstract HTMLCollection getOptions()
The collection of OPTION elements contained by this element.
abstract int getSelectedIndex()
The ordinal index of the selected option, starting from 0.
abstract int getSize()
Number of visible rows.
abstract int getTabIndex()
Index that represents the element's position in the tabbing order.
abstract String getType()
The type of this form control.
abstract String getValue()
The current form control value.
abstract void remove(int index)
Remove an element from the collection of OPTION elements for this SELECT .
abstract void setDisabled(boolean disabled)
abstract void setMultiple(boolean multiple)
abstract void setName(String name)
abstract void setSelectedIndex(int selectedIndex)
abstract void setSize(int size)
abstract void setTabIndex(int tabIndex)
abstract void setValue(String value)
[Expand]
Inherited Methods
From interface org.w3c.dom.Element
From interface org.w3c.dom.Node
From interface org.w3c.dom.html.HTMLElement

Public Methods

public abstract void add (HTMLElement element, HTMLElement before)

Add a new element to the collection of OPTION elements for this SELECT . This method is the equivalent of the appendChild method of the Node interface if the before parameter is null . It is equivalent to the insertBefore method on the parent of before in all other cases.

Parameters
element The element to add.
before The element to insert before, or null for the tail of the list.
Throws
DOMException NOT_FOUND_ERR: Raised if before is not a descendant of the SELECT element.

public abstract void blur ()

Removes keyboard focus from this element.

public abstract void focus ()

Gives keyboard focus to this element.

public abstract boolean getDisabled ()

The control is unavailable in this context. See the disabled attribute definition in HTML 4.0.

public abstract HTMLFormElement getForm ()

Returns the FORM element containing this control. Returns null if this control is not within the context of a form.

public abstract int getLength ()

The number of options in this SELECT .

public abstract boolean getMultiple ()

If true, multiple OPTION elements may be selected in this SELECT . See the multiple attribute definition in HTML 4.0.

public abstract String getName ()

Form control or object name when submitted with a form. See the name attribute definition in HTML 4.0.

public abstract HTMLCollection getOptions ()

The collection of OPTION elements contained by this element.

public abstract int getSelectedIndex ()

The ordinal index of the selected option, starting from 0. The value -1 is returned if no element is selected. If multiple options are selected, the index of the first selected option is returned.

public abstract int getSize ()

Number of visible rows. See the size attribute definition in HTML 4.0.

public abstract int getTabIndex ()

Index that represents the element's position in the tabbing order. See the tabindex attribute definition in HTML 4.0.

public abstract String getType ()

The type of this form control. This is the string "select-multiple" when the multiple attribute is true and the string "select-one" when false .

public abstract String getValue ()

The current form control value.

public abstract void remove (int index)

Remove an element from the collection of OPTION elements for this SELECT . Does nothing if no element has the given index.

Parameters
index The index of the item to remove, starting from 0.

public abstract void setDisabled (boolean disabled)

public abstract void setMultiple (boolean multiple)

public abstract void setName (String name)

public abstract void setSelectedIndex (int selectedIndex)

public abstract void setSize (int size)

public abstract void setTabIndex (int tabIndex)

public abstract void setValue (String value)