public interface HTMLOptionsCollection extends HTMLCollection<HTMLOptionElement>, Iterable<HTMLOptionElement>
| Modifier and Type | Method and Description |
|---|---|
void |
add(HTMLOptGroupElement group)
Inserts element at the end of the list.
|
void |
add(HTMLOptGroupElement group,
HTMLElement before)
Inserts element before the node given by before.
|
void |
add(HTMLOptGroupElement group,
int before)
Inserts element before the node given by before.
|
void |
add(HTMLOptionElement option)
Inserts element at the end of the list.
|
void |
add(HTMLOptionElement option,
HTMLElement before)
Inserts element before the node given by before.
|
void |
add(HTMLOptionElement option,
int before)
Inserts element before the node given by before.
|
HTMLOptionElement |
get(String name)
Returns the item with ID or name name from the collection.
|
int |
getLength()
Returns the number of elements in the collection.
|
int |
getSelectedIndex() |
HTMLOptionElement |
item(int index)
Returns the item with index index from the collection.
|
HTMLOptionElement |
namedItem(String name)
Returns the item with ID or name name from the collection.
|
void |
remove(int index)
Removes an option from the group.
|
void |
set(int index,
HTMLOptionElement option)
Sets an option element.
|
void |
setLength(int length)
Sets the number of elements in the collection.
|
void |
setSelectedIndex(int index) |
forEach, iterator, spliteratorHTMLOptionElement item(int index)
item in interface org.w3c.dom.html.HTMLCollectionitem in interface NodeListint getLength()
getLength in interface org.w3c.dom.html.HTMLCollectiongetLength in interface NodeListvoid setLength(int length)
length - the new lengthvoid set(int index,
HTMLOptionElement option)
index - the indexoption - If null, deletes the option at index.HTMLOptionElement namedItem(String name)
namedItem in interface org.w3c.dom.html.HTMLCollectionHTMLOptionElement get(String name)
name - the namevoid add(HTMLOptionElement option)
option - the new optionvoid add(HTMLOptionElement option, HTMLElement before)
option - the new optionbefore - insert it before this onevoid add(HTMLOptionElement option, int before)
option - the new optionbefore - insert it before this onevoid add(HTMLOptGroupElement group)
group - the new groupvoid add(HTMLOptGroupElement group, HTMLElement before)
group - the new groupbefore - insert before this elementvoid add(HTMLOptGroupElement group, int before)
group - the new groupbefore - insert before this elementvoid remove(int index)
index - If there is no option with this index, does nothing.int getSelectedIndex()
void setSelectedIndex(int index)
Copyright © 2017. All rights reserved.