public class HTMLSelectElement extends HTMLElement
HtmlSelect.HTMLElement.ProxyDomNodeATTRIBUTE_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.
|
HtmlSelect |
getDomNodeOrDie()
Returns the DOM node that corresponds to this JavaScript object or throw
an exception if one cannot be found.
|
HTMLFormElement |
getForm()
Returns the value of the JavaScript
form attribute. |
NodeList |
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.
|
ValidityState |
getValidity() |
String |
getValue()
Returns the actual value of the selected Option.
|
boolean |
getWillValidate() |
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 |
setCustomValidity(String message)
Sets the custom validity message for the element to the specified message.
|
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, 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, toStringafter, before, closest, 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, toggleAttribute, webkitMatchesSelectorasJavaScriptException, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFirstChild, getJavaScriptNode, getLastChild, getNextSibling, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentNode, getPreviousSibling, getRootNode, getTextContent, hasChildNodes, insertBefore, isSameNode, normalize, removeChild, replaceChild, setNodeValueaddEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandlerclone, equivalentValues, getBrowserVersion, getClassName, getDefaultValue, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setParentScopeapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, 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, sizepublic void initialize()
public HtmlSelect getDomNodeOrDie()
getDomNodeOrDie in class HTMLElementpublic 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 NodechildObject - the node to add to this nodepublic Object insertBeforeImpl(Object[] args)
insertBeforeImpl in class Nodeargs - 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 HTMLElementpublic 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.Scriptableget in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObjectindex - 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.Scriptableput in class net.sourceforge.htmlunit.corejs.javascript.ScriptableObjectindex - the indexstart - the scriptable object that was originally invoked for this propertynewValue - the new valuepublic void setValue(Object newValue)
setValue in class HTMLElementnewValue - 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 NodeList getLabels()
public boolean isRequired()
required property.required propertypublic void setRequired(boolean required)
required property.required - the new valuepublic String getName()
name.getName in class HTMLElementpublic void setName(String newName)
name.setName in class HTMLElementnewName - the new namepublic boolean isDisabled()
isDisabled in class HTMLElementpublic void setDisabled(boolean disabled)
setDisabled in class HTMLElementdisabled - True if this is to be disabledpublic HTMLFormElement getForm()
form attribute.getForm in class HTMLElementform attributepublic boolean checkValidity()
public ValidityState getValidity()
public boolean getWillValidate()
public void setCustomValidity(String message)
message - the new messageCopyright © 2002–2022 Gargoyle Software Inc.. All rights reserved.