Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface HTMLSelectElement
extends HTMLElement
Method Summary | |
void |
|
void |
|
void |
|
boolean |
|
HTMLFormElement |
|
int |
|
boolean |
|
String |
|
HTMLOptionsCollection |
|
int |
|
int |
|
int |
|
String |
|
String |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from interface org.w3c.dom.Element | |
getAttribute , getAttributeNS , getAttributeNode , getAttributeNodeNS , getElementsByTagName , getElementsByTagNameNS , getSchemaTypeInfo , getTagName , hasAttribute , hasAttributeNS , removeAttribute , removeAttributeNS , removeAttributeNode , setAttribute , setAttributeNS , setAttributeNode , setAttributeNodeNS , setIdAttribute , setIdAttributeNS , setIdAttributeNode |
Methods inherited from interface org.w3c.dom.html2.HTMLElement | |
getClassName , getDir , getId , getLang , getTitle , setClassName , setDir , setId , setLang , setTitle |
public void add(HTMLElement element, HTMLElement before) throws DOMException
Add a new element to the collection ofOPTION
elements for thisSELECT
. This method is the equivalent of theappendChild
method of theNode
interface if thebefore
parameter isnull
. It is equivalent to theinsertBefore
method on the parent ofbefore
in all other cases. This method may have no effect if the new element is not anOPTION
or anOPTGROUP
.
- Parameters:
element
- The element to add.before
- The element to insert before, ornull
for the tail of the list.
- Throws:
DOMException
- NOT_FOUND_ERR: Raised ifbefore
is not a descendant of theSELECT
element.
public void blur()
Removes keyboard focus from this element.
public void focus()
Gives keyboard focus to this element.
public boolean getDisabled()
The control is unavailable in this context. See the disabled attribute definition in HTML 4.01.
public HTMLFormElement getForm()
Returns theFORM
element containing this control. Returnsnull
if this control is not within the context of a form.
public int getLength()
The number of options in thisSELECT
.
public boolean getMultiple()
If true, multipleOPTION
elements may be selected in thisSELECT
. See the multiple attribute definition in HTML 4.01.
public String getName()
Form control or object name when submitted with a form. See the name attribute definition in HTML 4.01.
public HTMLOptionsCollection getOptions()
The collection ofOPTION
elements contained by this element.
public 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 int getSize()
Number of visible rows. See the size attribute definition in HTML 4.01.
public int getTabIndex()
Index that represents the element's position in the tabbing order. See the tabindex attribute definition in HTML 4.01.
public String getType()
The type of this form control. This is the string "select-multiple" when the multiple attribute istrue
and the string "select-one" whenfalse
.
public String getValue()
The current form control value (i.e. the value of the currently selected option), if multiple options are selected this is the value of the first selected option.
public void remove(int index)
Remove an element from the collection ofOPTION
elements for thisSELECT
. Does nothing if no element has the given index.
- Parameters:
index
- The index of the item to remove, starting from 0.
public void setDisabled(boolean disabled)
The control is unavailable in this context. See the disabled attribute definition in HTML 4.01.
public void setLength(int length) throws DOMException
The number of options in thisSELECT
.
- Throws:
DOMException
- NOT_SUPPORTED_ERR: if setting the length is not allowed by the implementation.
public void setMultiple(boolean multiple)
If true, multipleOPTION
elements may be selected in thisSELECT
. See the multiple attribute definition in HTML 4.01.
public void setName(String name)
Form control or object name when submitted with a form. See the name attribute definition in HTML 4.01.
public void setSelectedIndex(int selectedIndex)
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 void setSize(int size)
Number of visible rows. See the size attribute definition in HTML 4.01.
public void setTabIndex(int tabIndex)
Index that represents the element's position in the tabbing order. See the tabindex attribute definition in HTML 4.01.
public void setValue(String value)
The current form control value (i.e. the value of the currently selected option), if multiple options are selected this is the value of the first selected option.