public class HTMLSelectElement extends HTMLElement
HtmlSelect
.HTMLElement.ProxyDomNode
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
HTMLSelectElement()
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(HTMLOptionElement newOptionObject,
Object beforeOptionObject)
Adds a new item to the list (optionally) before the specified item.
|
Object |
appendChild(Object childObject)
Adds a DOM node to the node.
|
boolean |
checkValidity()
Checks whether the element has any constraints and whether it satisfies them.
|
Object |
get(int index,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
Returns the specified indexed property.
|
HTMLFormElement |
getForm()
Returns the value of the JavaScript
form attribute. |
AbstractList |
getLabels()
Returns the labels associated with the element.
|
int |
getLength()
Returns the value of the
length property. |
String |
getName()
Returns the value of the JavaScript attribute
name . |
HTMLOptionsCollection |
getOptions()
Returns the value of the
options property. |
int |
getSelectedIndex()
Returns the value of the
selectedIndex property. |
int |
getSize()
Returns the
size attribute. |
String |
getType()
Returns the type of this input.
|
String |
getValue()
Returns the actual value of the selected Option.
|
void |
initialize()
Initialize the object.
|
Object |
insertBeforeImpl(Object[] args)
Add a DOM node as a child to this node before the referenced node.
|
boolean |
isDisabled()
Returns true if this element is disabled.
|
boolean |
isMultiple()
Returns
true if the multiple attribute is set. |
boolean |
isRequired()
Returns the
required property. |
Object |
item(int index)
Gets the item at the specified index.
|
void |
put(int index,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start,
Object newValue)
Sets the index property.
|
void |
remove(int index)
Removes option at the specified index.
|
void |
setDisabled(boolean disabled)
Sets whether or not to disable this element.
|
void |
setLength(int newLength)
Removes options by reducing the
length property. |
void |
setMultiple(boolean multiple)
Sets or clears the
multiple attribute. |
void |
setName(String newName)
Sets the value of the JavaScript attribute
name . |
void |
setRequired(boolean required)
Sets the
required property. |
void |
setSelectedIndex(int index)
Sets the value of the
selectedIndex property. |
void |
setSize(String size)
Sets the
size attribute. |
void |
setValue(Object newValue)
Selects the option with the specified value.
|
blur, clearAttributes, click, contains, focus, getAccessKey, getAlign, getAttributeNode, getBoundingClientRect, getCh, getChildren, getChOff, getClassList, getClassName_js, getContentEditable, getCurrentStyle, getDataset, getDir, getDomNodeOrDie, getDomNodeOrNull, getElementsByClassName, getEnterKeyHint, getId, getInnerHTML, getInnerText, getLang, getLanguage, getLocalName, getNodeName, getOffsetHeight, getOffsetLeft, getOffsetParent_js, getOffsetTop, getOffsetWidth, getOnabort, getOnactivate, getOnanimationcancel, getOnanimationend, getOnanimationiteration, getOnanimationstart, getOnauxclick, getOnbeforeactivate, getOnbeforecopy, getOnbeforecut, getOnbeforedeactivate, getOnbeforepaste, getOnblur, getOncancel, getOncanplay, getOncanplaythrough, getOnchange, getOnclick, getOnclose, getOncontextmenu, getOncopy, getOncuechange, getOncut, getOndblclick, getOndeactivate, getOndrag, getOndragend, getOndragenter, getOndragleave, getOndragover, getOndragstart, getOndrop, getOndurationchange, getOnemptied, getOnended, getOnerror, getOnfocus, getOnfocusin, getOnfocusout, getOngotpointercapture, getOnhelp, getOninput, getOninvalid, getOnkeydown, getOnkeypress, getOnkeyup, getOnload, getOnloadeddata, getOnloadedmetadata, getOnloadstart, getOnlostpointercapture, getOnmousedown, getOnmouseenter, getOnmouseleave, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnmousewheel, getOnmozfullscreenchange, getOnmozfullscreenerror, getOnmscontentzoom, getOnmsmanipulationstatechanged, getOnpaste, getOnpause, getOnplay, getOnplaying, getOnpointercancel, getOnpointerdown, getOnpointerenter, getOnpointerleave, getOnpointermove, getOnpointerout, getOnpointerover, getOnpointerup, getOnprogress, getOnratechange, getOnreset, getOnresize, getOnscroll, getOnseeked, getOnseeking, getOnselect, getOnselectionchange, getOnselectstart, getOnstalled, getOnsubmit, getOnsuspend, getOntimeupdate, getOntoggle, getOntransitioncancel, getOntransitionend, getOntransitionrun, getOntransitionstart, getOnvolumechange, getOnwaiting, getOnwheel, getOuterHTML, getOuterText, getParentElement, getParentHTMLElement, getPosX, getPosY, getPrefix, getRuntimeStyle, getStyle, getTabIndex, getTitle, getUniqueID, getVAlign, getWidthOrHeight, insertAdjacentElement, insertAdjacentHTML, insertAdjacentText, isAncestorOfEventTarget, isEndTagForbidden, isHidden, isIsContentEditable, isLowerCaseInOuterHtml, isSpellcheck, mergeAttributes, readAttributes, releaseCapture, removeNode, scrollIntoView, setAccessKey, setActive, setAlign, setAttribute, setCapture, setCh, setChOff, setClassName_js, setColorAttribute, setContentEditable, setDir, setDomNode, setEnterKeyHint, setHidden, setId, setInnerHTML, setInnerText, setLang, setLanguage, setOnabort, setOnactivate, setOnanimationcancel, setOnanimationend, setOnanimationiteration, setOnanimationstart, setOnauxclick, setOnbeforeactivate, setOnbeforecopy, setOnbeforecut, setOnbeforedeactivate, setOnbeforepaste, setOnblur, setOncancel, setOncanplay, setOncanplaythrough, setOnchange, setOnclick, setOnclose, setOncontextmenu, setOncopy, setOncuechange, setOncut, setOndblclick, setOndeactivate, setOndrag, setOndragend, setOndragenter, setOndragleave, setOndragover, setOndragstart, setOndrop, setOndurationchange, setOnemptied, setOnended, setOnerror, setOnfocus, setOnfocusin, setOnfocusout, setOngotpointercapture, setOnhelp, setOninput, setOninvalid, setOnkeydown, setOnkeypress, setOnkeyup, setOnload, setOnloadeddata, setOnloadedmetadata, setOnloadstart, setOnlostpointercapture, setOnmousedown, setOnmouseenter, setOnmouseleave, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnmousewheel, setOnmozfullscreenchange, setOnmozfullscreenerror, setOnmscontentzoom, setOnmsmanipulationstatechanged, setOnpaste, setOnpause, setOnplay, setOnplaying, setOnpointercancel, setOnpointerdown, setOnpointerenter, setOnpointerleave, setOnpointermove, setOnpointerout, setOnpointerover, setOnpointerup, setOnprogress, setOnratechange, setOnreset, setOnresize, setOnscroll, setOnseeked, setOnseeking, setOnselect, setOnselectionchange, setOnselectstart, setOnstalled, setOnsubmit, setOnsuspend, setOntimeupdate, setOntoggle, setOntransitioncancel, setOntransitionend, setOntransitionrun, setOntransitionstart, setOnvolumechange, setOnwaiting, setOnwheel, setOuterHTML, setSpellcheck, setStyle, setTabIndex, setTextContent, setTitle, setVAlign, setWidthOrHeight, toString
after, before, createAttributesObject, createEventHandler, createTextRange, get, getAttribute, getAttributeNodeNS, getAttributeNS, getAttributes, getChildElementCount, getClientHeight, getClientLeft, getClientRects, getClientTop, getClientWidth, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getInnerHTML, getLastElementChild, getNamespaceURI, getNextElementSibling, getOnmsgesturechange, getOnmsgesturedoubletap, getOnmsgestureend, getOnmsgesturehold, getOnmsgesturestart, getOnmsgesturetap, getOnmsgotpointercapture, getOnmsinertiastart, getOnmslostpointercapture, getOnmspointercancel, getOnmspointerdown, getOnmspointerenter, getOnmspointerleave, getOnmspointermove, getOnmspointerout, getOnmspointerover, getOnmspointerup, getOnsearch, getOnwebkitfullscreenchange, getOnwebkitfullscreenerror, getPreviousElementSibling, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getTagName, hasAttribute, hasAttributeNS, hasAttributes, innerHTML, isDisplayNone, matches, mozMatchesSelector, msMatchesSelector, printChildren, printNode, querySelector, querySelectorAll, remove, removeAttribute, removeAttributeNode, removeAttributeNS, replaceWith, scrollIntoViewIfNeeded, setAttributeNode, setAttributeNS, setDefaults, setOnmsgesturechange, setOnmsgesturedoubletap, setOnmsgestureend, setOnmsgesturehold, setOnmsgesturestart, setOnmsgesturetap, setOnmsgotpointercapture, setOnmsinertiastart, setOnmslostpointercapture, setOnmspointercancel, setOnmspointerdown, setOnmspointerenter, setOnmspointerleave, setOnmspointermove, setOnmspointerout, setOnmspointerover, setOnmspointerup, setOnsearch, setOnwebkitfullscreenchange, setOnwebkitfullscreenerror, setScrollLeft, setScrollTop, webkitMatchesSelector
asJavaScriptException, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFirstChild, getJavaScriptNode, getLastChild, getNextSibling, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentNode, getPreviousSibling, getTextContent, hasChildNodes, insertBefore, isSameNode, normalize, removeChild, replaceChild, setNodeValue
addEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandler
clone, equivalentValues, getBrowserVersion, getDefaultValue, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode
defineFunctionProperties, defineProperty, getClassName, put, setClassName, setParentScope
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
public void initialize()
public void remove(int index)
index
- the index of the item to removepublic void add(HTMLOptionElement newOptionObject, Object beforeOptionObject)
newOptionObject
- the DomNode to insertbeforeOptionObject
- for Firefox: the DomNode to insert the previous element before (null if at end),
for Internet Explorer: the index where the element should be placed (optional).public Object appendChild(Object childObject)
appendChild
in class Node
childObject
- the node to add to this nodepublic Object insertBeforeImpl(Object[] args)
insertBeforeImpl
in class Node
args
- the argumentspublic Object item(int index)
index
- the position of the option to retrievepublic String getType()
public HTMLOptionsCollection getOptions()
options
property.options
propertypublic int getSelectedIndex()
selectedIndex
property.selectedIndex
propertypublic void setSelectedIndex(int index)
selectedIndex
property.index
- the new valuepublic String getValue()
getValue
in class HTMLElement
public int getLength()
length
property.length
propertypublic void setLength(int newLength)
length
property.newLength
- the new length
property valuepublic Object get(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
get
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
get
in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
index
- the index of the propertystart
- the scriptable object that was originally queried for this propertypublic void put(int index, net.sourceforge.htmlunit.corejs.javascript.Scriptable start, Object newValue)
put
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
put
in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
index
- the indexstart
- the scriptable object that was originally invoked for this propertynewValue
- the new valuepublic void setValue(Object newValue)
setValue
in class HTMLElement
newValue
- the value of the option to selectpublic int getSize()
size
attribute.size
attributepublic void setSize(String size)
size
attribute.size
- the size
attributepublic boolean isMultiple()
true
if the multiple
attribute is set.true
if the multiple
attribute is setpublic void setMultiple(boolean multiple)
multiple
attribute.multiple
- true
to set the multiple
attribute, false
to clear itpublic AbstractList getLabels()
public boolean checkValidity()
public boolean isRequired()
required
property.required
propertypublic void setRequired(boolean required)
required
property.required
- the new valuepublic String getName()
name
.getName
in class HTMLElement
public void setName(String newName)
name
.setName
in class HTMLElement
newName
- the new namepublic boolean isDisabled()
isDisabled
in class HTMLElement
public void setDisabled(boolean disabled)
setDisabled
in class HTMLElement
disabled
- True if this is to be disabledpublic HTMLFormElement getForm()
form
attribute.getForm
in class HTMLElement
form
attributeCopyright © 2002–2021 Gargoyle Software Inc.. All rights reserved.