public class HTMLInputElement extends HTMLElement
HtmlInput.HTMLElement.ProxyDomNodeorg.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunctionATTRIBUTE_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_NODECONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTNOT_FOUND| Constructor and Description |
|---|
HTMLInputElement() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkValidity()
Checks whether the element has any constraints and whether it satisfies them.
|
void |
click()
Click this element.
|
String |
getAccept()
Returns the
accept attribute. |
String |
getAlign()
Returns the value of the
align property. |
String |
getAlt()
Returns the value of the
alt property. |
String |
getAttribute(String attributeName) |
String |
getAutocomplete()
Returns the
autocomplete attribute. |
DOMRectList |
getClientRects()
Retrieves a collection of rectangles that describes the layout of the contents of an object
or range within the client.
|
String |
getDefaultValue()
Returns the input's default value, used if the containing form gets reset.
|
HtmlInput |
getDomNodeOrDie()
Returns the DOM node that corresponds to this JavaScript object or throw
an exception if one cannot be found.
|
FileList |
getFiles()
Returns the
files property. |
HTMLFormElement |
getForm()
Returns the value of the JavaScript
form attribute. |
int |
getHeight()
Returns the
height property. |
NodeList |
getLabels()
Returns the labels associated with the element.
|
String |
getMax()
Gets the
max property. |
int |
getMaxLength()
Gets the max length.
|
String |
getMin()
Gets the
min property. |
int |
getMinLength()
Gets the
minLength. |
String |
getName()
Returns the value of the JavaScript attribute
name. |
String |
getPlaceholder()
Returns the
placeholder attribute. |
Integer |
getSelectionEnd()
Gets the value of
selectionEnd attribute. |
Integer |
getSelectionStart()
Gets the value of
selectionStart attribute. |
String |
getSize()
Returns the
size attribute. |
String |
getSrc()
Returns the value of the
src attribute. |
String |
getStep()
Gets the
step property. |
int |
getTextLength()
Gets the value of
textLength attribute. |
String |
getType()
Returns the
type property. |
ValidityState |
getValidity() |
String |
getValue()
Returns the value of the JavaScript attribute
value. |
int |
getWidth()
Returns the
width property. |
boolean |
isChecked()
Returns the value of the checked property.
|
boolean |
isDefaultChecked()
Returns the input's default checked value, used if the containing form gets reset.
|
boolean |
isDisabled()
Returns true if this element is disabled.
|
protected boolean |
isEndTagForbidden()
Returns whether the end tag is forbidden or not.
|
boolean |
isFormNoValidate()
Returns the value of the property
formnovalidate. |
boolean |
isReadOnly()
Gets the value of
readOnly attribute. |
boolean |
isRequired()
Returns the
required property. |
boolean |
isWillValidate() |
void |
jsConstructor()
JavaScript constructor.
|
void |
select()
Select this element.
|
void |
setAccept(String accept)
Sets the
accept attribute. |
void |
setAlign(String align)
Sets the value of the
align property. |
void |
setAlt(String alt)
Returns the value of the
alt property. |
void |
setAutocomplete(String autocomplete)
Sets the
autocomplete attribute. |
void |
setChecked(boolean checked)
Sets the checked property.
|
void |
setCustomValidity(String message)
Sets the custom validity message for the element to the specified message.
|
void |
setDefaultChecked(boolean defaultChecked)
Sets the input's default checked value, used if the containing form gets reset.
|
void |
setDefaultValue(String defaultValue)
Sets the input's default value, used if the containing form gets reset.
|
void |
setDisabled(boolean disabled)
Sets whether or not to disable this element.
|
void |
setFormNoValidate(boolean value)
Sets the value of the property
formnovalidate. |
void |
setHeight(int height)
Sets the
height property. |
void |
setMax(String max)
Sets the
max property. |
void |
setMaxLength(int length)
Sets the value of
maxLength attribute. |
void |
setMin(String min)
Sets the
min property. |
void |
setMinLength(int length)
Sets the value of
minLength attribute. |
void |
setName(String newName)
Sets the value of the JavaScript attribute
name. |
void |
setPlaceholder(String placeholder)
Sets the
placeholder attribute. |
void |
setReadOnly(boolean readOnly)
Sets the value of
readOnly attribute. |
void |
setRequired(boolean required)
Sets the
required property. |
void |
setSelectionEnd(int end)
Sets the value of
selectionEnd attribute. |
void |
setSelectionRange(int start,
int end)
Sets the selected portion of this input element.
|
void |
setSelectionStart(int start)
Sets the value of
selectionStart attribute. |
void |
setSize(String size)
Sets the
size attribute. |
void |
setSrc(String src)
Sets the value of the
src attribute. |
void |
setStep(String step)
Sets the
step property. |
void |
setType(String newType)
Sets the value of the attribute
type. |
void |
setValue(Object newValue)
Sets the value of the JavaScript attribute
value. |
void |
setWidth(int width)
Sets the
width property. |
blur, focus, getAccessKey, getAlign, getAttributeNode, getBoundingClientRect, getCh, getChOff, getContentEditable, getDataset, getDir, getDomNodeOrNull, getEnterKeyHint, getHidden, getInnerText, getLang, getLocalName, getNodeName, getOffsetHeight, getOffsetLeft, getOffsetParent_js, getOffsetTop, getOffsetWidth, getOnabort, getOnanimationcancel, getOnanimationend, getOnanimationiteration, getOnanimationstart, getOnauxclick, getOnblur, getOncancel, getOncanplay, getOncanplaythrough, getOnchange, getOnclick, getOnclose, getOncontextmenu, getOncopy, getOncuechange, getOncut, getOndblclick, getOndrag, getOndragend, getOndragenter, getOndragleave, getOndragover, getOndragstart, getOndrop, getOndurationchange, getOnemptied, getOnended, getOnerror, getOnfocus, getOngotpointercapture, getOninput, getOninvalid, getOnkeydown, getOnkeypress, getOnkeyup, getOnload, getOnloadeddata, getOnloadedmetadata, getOnloadstart, getOnlostpointercapture, getOnmousedown, getOnmouseenter, getOnmouseleave, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnmousewheel, getOnmozfullscreenchange, getOnmozfullscreenerror, getOnpaste, getOnpause, getOnplay, getOnplaying, getOnpointercancel, getOnpointerdown, getOnpointerenter, getOnpointerleave, getOnpointermove, getOnpointerout, getOnpointerover, getOnpointerup, getOnprogress, getOnratechange, getOnreset, getOnresize, getOnscroll, getOnscrollend, getOnseeked, getOnseeking, getOnselect, getOnselectionchange, getOnselectstart, getOnstalled, getOnsubmit, getOnsuspend, getOntimeupdate, getOntoggle, getOntransitioncancel, getOntransitionend, getOntransitionrun, getOntransitionstart, getOnvolumechange, getOnwaiting, getOnwheel, getOuterText, getParentHTMLElement, getPosX, getPosY, getPrefix, getStyle, getTabIndex, getTitle, getVAlign, getWidthOrHeight, isAncestorOfEventTarget, isAutofocus, isIsContentEditable, isLowerCaseInOuterHtml, isSpellcheck, setAccessKey, setAlign, setAttribute, setAutofocus, setCh, setChOff, setColorAttribute, setContentEditable, setDir, setDomNode, setEnterKeyHint, setHidden, setInnerText, setLang, setOnabort, setOnanimationcancel, setOnanimationend, setOnanimationiteration, setOnanimationstart, setOnauxclick, setOnblur, setOncancel, setOncanplay, setOncanplaythrough, setOnchange, setOnclick, setOnclose, setOncontextmenu, setOncopy, setOncuechange, setOncut, setOndblclick, setOndrag, setOndragend, setOndragenter, setOndragleave, setOndragover, setOndragstart, setOndrop, setOndurationchange, setOnemptied, setOnended, setOnerror, setOnfocus, setOngotpointercapture, setOninput, setOninvalid, setOnkeydown, setOnkeypress, setOnkeyup, setOnload, setOnloadeddata, setOnloadedmetadata, setOnloadstart, setOnlostpointercapture, setOnmousedown, setOnmouseenter, setOnmouseleave, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnmousewheel, setOnmozfullscreenchange, setOnmozfullscreenerror, setOnpaste, setOnpause, setOnplay, setOnplaying, setOnpointercancel, setOnpointerdown, setOnpointerenter, setOnpointerleave, setOnpointermove, setOnpointerout, setOnpointerover, setOnpointerup, setOnprogress, setOnratechange, setOnreset, setOnresize, setOnscroll, setOnscrollend, setOnseeked, setOnseeking, setOnselect, setOnselectionchange, setOnselectstart, setOnstalled, setOnsubmit, setOnsuspend, setOntimeupdate, setOntoggle, setOntransitioncancel, setOntransitionend, setOntransitionrun, setOntransitionstart, setOnvolumechange, setOnwaiting, setOnwheel, setOuterText, setSpellcheck, setStyle, setTabIndex, setTextContent, setTitle, setVAlign, setWidthOrHeight, toStringafter, append, before, closest, createAttributesObject, createEventHandler, getAttributeNodeNS, getAttributeNS, getAttributes, getChildElementCount, getChildren, getClassList, getClassName_js, getClientHeight, getClientLeft, getClientTop, getClientWidth, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getHTML, getId, getInnerHTML, getInnerHTML, getLastElementChild, getNamespaceURI, getNextElementSibling, getOnbeforecopy, getOnbeforecut, getOnbeforepaste, getOnsearch, getOnwebkitfullscreenchange, getOnwebkitfullscreenerror, getOuterHTML, getParentElement, getPreviousElementSibling, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getTagName, hasAttribute, hasAttributeNS, hasAttributes, insertAdjacentElement, insertAdjacentHTML, insertAdjacentText, isDisplayNone, matches, mozMatchesSelector, prepend, printChildren, printNode, querySelector, querySelectorAll, releaseCapture, remove, removeAttribute, removeAttributeNode, removeAttributeNS, replaceChildren, replaceWith, scroll, scrollBy, scrollIntoView, scrollIntoViewIfNeeded, scrollTo, setAttributeNode, setAttributeNS, setCapture, setClassName_js, setId, setInnerHTML, setOnbeforecopy, setOnbeforecut, setOnbeforepaste, setOnsearch, setOnwebkitfullscreenchange, setOnwebkitfullscreenerror, setOuterHTML, setScrollLeft, setScrollTop, toggleAttribute, webkitMatchesSelectorafter, append, appendChild, before, cloneNode, compareDocumentPosition, contains, getBaseURI, getChildNodes, getFirstChild, getJavaScriptNode, getLastChild, getNextSibling, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentNode, getPreviousSibling, getRootNode, getTextContent, hasChildNodes, insertBefore, insertBeforeImpl, isEqualNode, isSameNode, lookupPrefix, normalize, prepend, removeChild, replaceChild, replaceChildren, replaceWith, setNodeValueaddEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandlerclone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getPrototype, getScriptableFor, getWindow, getWindow, getWindowFromTopCallScope, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setParentScope, setupPromise, setupRejectedPromiseapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkSlotRemoval, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, 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, getSuperProperty, getSuperProperty, getSuperProperty, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, sizecreateSlotMappublic void jsConstructor()
jsConstructor in class HTMLElementpublic String getType()
type property.type propertypublic void setType(String newType)
type.
Note: this replaces the DOM node with a new one.newType - the new type to setpublic void setValue(Object newValue)
value.setValue in class HTMLElementnewValue - the new valuepublic void setChecked(boolean checked)
checked - True if this input should have the checked attribute setpublic HtmlInput getDomNodeOrDie()
getDomNodeOrDie in class HTMLElementpublic boolean isChecked()
public void select()
public String getDefaultValue()
public void setDefaultValue(String defaultValue)
defaultValue - the input's default value, used if the containing form gets resetpublic boolean isDefaultChecked()
public void setDefaultChecked(boolean defaultChecked)
defaultChecked - the input's default checked value, used if the containing form gets resetpublic int getTextLength()
textLength attribute.public Integer getSelectionStart()
selectionStart attribute.public void setSelectionStart(int start)
selectionStart attribute.start - selection startpublic Integer getSelectionEnd()
selectionEnd attribute.public void setSelectionEnd(int end)
selectionEnd attribute.end - selection endpublic int getMaxLength()
public void setMaxLength(int length)
maxLength attribute.length - the new valuepublic int getMinLength()
minLength.minLengthpublic void setMinLength(int length)
minLength attribute.length - the new valuepublic String getMin()
min property.min propertypublic void setMin(String min)
min property.min - the min propertypublic String getMax()
max property.max propertypublic void setMax(String max)
max property.max - the max propertypublic String getStep()
step property.step propertypublic void setStep(String step)
step property.step - the step propertypublic boolean isReadOnly()
readOnly attribute.public void setReadOnly(boolean readOnly)
readOnly attribute.readOnly - the new valuepublic void setSelectionRange(int start,
int end)
start - the index of the first character to selectend - the index of the character after the selectionpublic String getAlt()
alt property.alt propertypublic void setAlt(String alt)
alt property.alt - the valuepublic String getAlign()
align property.align propertypublic void setAlign(String align)
align property.align - the value of the align propertypublic String getSrc()
src attribute.src attributepublic void setSrc(String src)
src attribute.src - the new valuepublic String getValue()
value.getValue in class HTMLElementpublic String getAttribute(String attributeName)
getAttribute in class ElementattributeName - attribute namenull if the attribute is not definedpublic void click()
throws IOException
click in class HTMLElementIOException - if this click triggers a page load that encounters problemsprotected boolean isEndTagForbidden()
isEndTagForbidden in class HTMLElementpublic boolean isRequired()
required property.required propertypublic void setRequired(boolean required)
required property.required - the new valuepublic String getSize()
size attribute.size attributepublic void setSize(String size)
size attribute.size - the new size valuepublic String getAccept()
accept attribute.accept attributepublic void setAccept(String accept)
accept attribute.accept - the new accept valuepublic String getAutocomplete()
autocomplete attribute.autocomplete attributepublic void setAutocomplete(String autocomplete)
autocomplete attribute.autocomplete - the new autocomplete valuepublic FileList getFiles()
files property.files propertypublic String getPlaceholder()
placeholder attribute.placeholder attributepublic void setPlaceholder(String placeholder)
placeholder attribute.placeholder - the new placeholder valuepublic int getWidth()
width property.width propertypublic void setWidth(int width)
width property.width - the width propertypublic int getHeight()
height property.height propertypublic void setHeight(int height)
height property.height - the height propertypublic NodeList getLabels()
public boolean checkValidity()
public 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 ValidityState getValidity()
public boolean isWillValidate()
public void setCustomValidity(String message)
message - the new messagepublic boolean isFormNoValidate()
formnovalidate.public void setFormNoValidate(boolean value)
formnovalidate.value - the new valuepublic DOMRectList getClientRects()
getClientRects in class ElementCopyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.