FileDocCategorySizeDatePackage
HTMLSelectElement.javaAPI DocJava SE 5 API4602Fri Aug 26 14:58:40 BST 2005org.w3c.dom.html

HTMLSelectElement

public interface HTMLSelectElement implements HTMLElement
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.

Fields Summary
Constructors Summary
Methods Summary
public voidadd(org.w3c.dom.html.HTMLElement element, org.w3c.dom.html.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.

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

public voidblur()
Removes keyboard focus from this element.

public voidfocus()
Gives keyboard focus to this element.

public booleangetDisabled()
The control is unavailable in this context. See the disabled attribute definition in HTML 4.0.

public org.w3c.dom.html.HTMLFormElementgetForm()
Returns the FORM element containing this control. Returns null if this control is not within the context of a form.

public intgetLength()
The number of options in this SELECT .

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

public java.lang.StringgetName()
Form control or object name when submitted with a form. See the name attribute definition in HTML 4.0.

public org.w3c.dom.html.HTMLCollectiongetOptions()
The collection of OPTION elements contained by this element.

public intgetSelectedIndex()
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 intgetSize()
Number of visible rows. See the size attribute definition in HTML 4.0.

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

public java.lang.StringgetType()
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 java.lang.StringgetValue()
The current form control value.

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

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

public voidsetDisabled(boolean disabled)

public voidsetMultiple(boolean multiple)

public voidsetName(java.lang.String name)

public voidsetSelectedIndex(int selectedIndex)

public voidsetSize(int size)

public voidsetTabIndex(int tabIndex)

public voidsetValue(java.lang.String value)