Package org.loboevolution.html.dom
Interface HTMLSelectElement
- All Superinterfaces:
Element
,EventTarget
,HTMLElement
,InnerHTML
,Node
,NonDocumentTypeChildNode
,ParentNode
- All Known Implementing Classes:
HTMLSelectElementImpl
A <select> HTML Element. These elements also share all of the properties and methods of other HTML elements via
the HTMLElement interface.
-
Field Summary
Fields inherited from interface org.loboevolution.html.node.Node
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, NONE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add.void
Adds an element to the areas, controlRange, or options collection.boolean
Returns whether a form will validate when it is submitted, without having to submit it.getForm()
Retrieves a reference to the form that the object is embedded in.Gets labels.int
getLength.getName()
Sets or retrieves the name of the object.Gets options.int
Sets or retrieves the index of the selected option in a select object.Gets selected options.int
getSize()
Sets or retrieves the number of rows in the list box.getType()
Retrieves the type of select control based on the value of the MULTIPLE attribute.Returns the error message that would be displayed if the user submits the form, or an empty string if no error message.Returns a ValidityState object that represents the validity states of an element.getValue()
Sets or retrieves the value which is returned to the server when the form control is submitted.boolean
Gets autocomplete.boolean
Provides a way to direct a user to a specific field when a document loads.boolean
Is disabled boolean.boolean
Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.boolean
When present, marks an element that can't be submitted without a value.boolean
Returns whether an element will successfully validate based on forms validation rules and constraints.item
(int index) Retrieves a select object or an object from an options collection.Retrieves a select object or an object from an options collection.void
remove()
Removes an element from the collection.void
Remove.boolean
Report validity boolean.void
setAutocomplete
(String autocomplete) Sets autocomplete.void
setAutofocus
(boolean autofocus) Sets autofocus.void
setCustomValidity
(String error) Sets a custom error message that is displayed when a form is submitted.void
setDisabled
(boolean disabled) Sets disabled.void
Set Item.void
setLength
(int length) Sets or retrieves the number of objects in a collection.void
setMultiple
(boolean multiple) Sets multiple.void
Sets name.void
setRequired
(boolean required) Sets required.void
setSelectedIndex
(int selectedIndex) Sets selected index.void
setSize
(int size) Sets size.void
Sets value.Methods inherited from interface org.loboevolution.html.node.Element
closest, getAttribute, getAttributeNames, getAttributeNode, getAttributeNodeNS, getAttributeNS, getBoundingClientRect, getClassList, getClassName, getClientHeight, getClientLeft, getClientRects, getClientTop, getClientWidth, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getId, getInnerHTML, getLocalName, getNamespaceURI, getOuterHTML, getPrefix, getSchemaTypeInfo, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getSlot, getTagName, hasAttribute, hasAttributeNS, hasPointerCapture, insertAdjacentElement, insertAdjacentHTML, matches, releasePointerCapture, removeAttribute, removeAttributeNode, removeAttributeNS, requestPointerLock, scroll, scrollBy, scrollIntoView, scrollIntoView, scrollTo, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setClassName, setId, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setOuterHTML, setPointerCapture, setScrollLeft, setScrollTop, setSlot, toggleAttribute, toggleAttribute
Methods inherited from interface org.loboevolution.events.EventTarget
addEventListener, addEventListener, dispatchEvent, dispatchEvent, removeEventListener, removeEventListener
Methods inherited from interface org.loboevolution.html.dom.HTMLElement
click, getAccessKey, getAccessKeyLabel, getAutocapitalize, getContentEditable, getDir, getInnerText, getLang, getOffsetHeight, getOffsetLeft, getOffsetParent, getOffsetTop, getOffsetWidth, getTitle, isDraggable, isHidden, isSpellcheck, isTranslate, setAccessKey, setAutocapitalize, setContentEditable, setDir, setDraggable, setHidden, setInnerText, setLang, setSpellcheck, setTitle, setTranslate
Methods inherited from interface org.loboevolution.html.node.InnerHTML
setInnerHTML
Methods inherited from interface org.loboevolution.html.node.Node
appendChild, cloneNode, cloneNode, compareDocumentPosition, contains, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPreviousSibling, getRootNode, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isIsConnected, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, prepend, prependChild, removeChild, replaceChild, setNodeValue, setOwnerDocument, setPrefix, setTextContent, setUserData
Methods inherited from interface org.loboevolution.html.node.NonDocumentTypeChildNode
getNextElementSibling, getPreviousElementSibling
Methods inherited from interface org.loboevolution.html.node.ParentNode
getChildElementCount, getChildren, getFirstElementChild, getLastElementChild, querySelector, querySelectorAll
-
Method Details
-
isAutocomplete
boolean isAutocomplete()Gets autocomplete.- Returns:
- the autocomplete
-
setAutocomplete
Sets autocomplete.- Parameters:
autocomplete
- the autocomplete
-
isAutofocus
boolean isAutofocus()Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.- Returns:
- the boolean
-
setAutofocus
void setAutofocus(boolean autofocus) Sets autofocus.- Parameters:
autofocus
- the autofocus
-
isDisabled
boolean isDisabled()Is disabled boolean.- Returns:
- the boolean
-
setDisabled
void setDisabled(boolean disabled) Sets disabled.- Parameters:
disabled
- the disabled
-
getForm
HTMLFormElement getForm()Retrieves a reference to the form that the object is embedded in.- Returns:
- the form
-
getLabels
NodeList getLabels()Gets labels.- Returns:
- the labels
-
setLength
void setLength(int length) Sets or retrieves the number of objects in a collection.- Parameters:
length
- the length
-
isMultiple
boolean isMultiple()Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.- Returns:
- the boolean
-
setMultiple
void setMultiple(boolean multiple) Sets multiple.- Parameters:
multiple
- the multiple
-
getName
String getName()Sets or retrieves the name of the object.- Returns:
- the name
-
setName
Sets name.- Parameters:
name
- the name
-
getOptions
HTMLOptionsCollection getOptions()Gets options.- Returns:
- the options
-
isRequired
boolean isRequired()When present, marks an element that can't be submitted without a value.- Returns:
- the boolean
-
setRequired
void setRequired(boolean required) Sets required.- Parameters:
required
- the required
-
getSelectedIndex
int getSelectedIndex()Sets or retrieves the index of the selected option in a select object.- Returns:
- the selected index
-
setSelectedIndex
void setSelectedIndex(int selectedIndex) Sets selected index.- Parameters:
selectedIndex
- the selected index
-
getSelectedOptions
HTMLCollection getSelectedOptions()Gets selected options.- Returns:
- the selected options
-
getSize
int getSize()Sets or retrieves the number of rows in the list box.- Returns:
- the size
-
setSize
void setSize(int size) Sets size.- Parameters:
size
- the size
-
getType
String getType()Retrieves the type of select control based on the value of the MULTIPLE attribute.- Returns:
- the type
-
getValidationMessage
String getValidationMessage()Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting.- Returns:
- the validation message
-
getValidity
ValidityState getValidity()Returns a ValidityState object that represents the validity states of an element.- Returns:
- the validity
-
getValue
String getValue()Sets or retrieves the value which is returned to the server when the form control is submitted.- Returns:
- the value
-
setValue
Sets value.- Parameters:
value
- the value
-
isWillValidate
boolean isWillValidate()Returns whether an element will successfully validate based on forms validation rules and constraints.- Returns:
- the boolean
-
add
Adds an element to the areas, controlRange, or options collection.- Parameters:
element
- Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.before
- Variant of type Object that specifies an element to insert before, or null to append the object to the collection.
-
add
Add.- Parameters:
element
- the element
-
checkValidity
boolean checkValidity()Returns whether a form will validate when it is submitted, without having to submit it.- Returns:
- the boolean
-
item
Retrieves a select object or an object from an options collection.- Parameters:
index
- Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.- Returns:
- the element
-
namedItem
Retrieves a select object or an object from an options collection.- Parameters:
name
- A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.- Returns:
- the html option element
-
remove
void remove()Removes an element from the collection. -
remove
Remove.- Parameters:
element
- the element
-
reportValidity
boolean reportValidity()Report validity boolean.- Returns:
- the boolean
-
setCustomValidity
Sets a custom error message that is displayed when a form is submitted.- Parameters:
error
- Sets a custom error message that is displayed when a form is submitted.
-
setItem
Set Item.- Parameters:
index
- the nameNode
- the value
-
getLength
int getLength()getLength.
- Returns:
- a
Integer
object.
-