| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HTMLSelectElement extends 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.
Field Summary |
---|
Method Summary | |
---|---|
void |
add(HTMLElement element, HTMLElement before) Add a new element to the collection of OPTION elements
for this SELECT .
|
void |
blur() Removes keyboard focus from this element. |
void |
focus() Gives keyboard focus to this element. |
boolean |
The control is unavailable in this context. |
HTMLFormElement |
getForm() Returns the FORM element containing this control.
|
int |
The number of options in this SELECT .
|
boolean |
If true, multiple OPTION elements may be selected in
this SELECT .
|
String |
getName() Form control or object name when submitted with a form. |
HTMLCollection |
The collection of OPTION elements contained by this
element.
|
int |
The ordinal index of the selected option, starting from 0. |
int |
getSize() Number of visible rows. |
int |
Index that represents the element's position in the tabbing order. |
String |
getType() The type of this form control. |
String |
getValue() The current form control value. |
void |
remove(int index) Remove an element from the collection of OPTION elements
for this SELECT .
|
void |
setDisabled(boolean disabled) |
void |
setMultiple(boolean multiple) |
void |
|
void |
setSelectedIndex(int selectedIndex) |
void |
setSize(int size) |
void |
setTabIndex(int tabIndex) |
void |
|
Methods inherited from class org.w3c.dom.html.HTMLElement |
---|
getClassName, getDir, getId, getLang, getTitle, setClassName, setDir, setId, setLang, setTitle |
Method Detail |
---|
public void add(HTMLElement element, HTMLElement before) throws DOMException
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.
element
- The element to add.before
- The element to insert before, or null
for
the tail of the list.DOMException
- NOT_FOUND_ERR: Raised if before
is not a descendant of
the SELECT
element.public void blur()
public void focus()
public boolean getDisabled()
public HTMLFormElement getForm()
FORM
element containing this control. Returns
null
if this control is not within the context of a form.
public int getLength()
SELECT
.
public boolean getMultiple()
OPTION
elements may be selected in
this SELECT
. See the multiple attribute definition in
HTML 4.0.
public String getName()
public HTMLCollection getOptions()
OPTION
elements contained by this
element.
public int getSelectedIndex()
public int getSize()
public int getTabIndex()
public String getType()
true
and the string
"select-one" when false
.
public String getValue()
public void remove(int index)
OPTION
elements
for this SELECT
. Does nothing if no element has the given
index.
index
- The index of the item to remove, starting from 0.public void setDisabled(boolean disabled)
disabled
public void setMultiple(boolean multiple)
multiple
public void setName(String name)
name
public void setSelectedIndex(int selectedIndex)
selectedIndex
public void setSize(int size)
size
public void setTabIndex(int tabIndex)
tabIndex
public void setValue(String value)
value
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |