public interface TextAreaElement extends Element
TextArea
objects expose the HTMLTextAreaElement (or
HTML 4 HTMLTextAreaElement
) interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of <textarea>
elements.ALLOW_KEYBOARD_INPUT
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
Modifier and Type | Method and Description |
---|---|
boolean |
checkValidity()
Returns false if the button is a candidate for constraint validation, and it does not satisfy its constraints.
|
int |
getCols()
Reflects the
cols
HTML attribute, indicating the visible width of the text area. |
String |
getDefaultValue()
The control's default value, which behaves like the textContent property.
|
String |
getDirName() |
FormElement |
getForm()
The containing form element, if this element is in a form.
|
NodeList |
getLabels()
A list of
<label>
elements that are labels for this element. |
int |
getMaxLength()
Reflects the
maxlength
HTML attribute, indicating the maximum number of characters the user can enter. |
String |
getName()
Reflects
name
HTML attribute, containing the name of the control. |
String |
getPlaceholder()
Reflects the
placeholder
HTML attribute, containing a hint to the user about what to enter in the control. |
int |
getRows()
Reflects the
rows
HTML attribute, indicating the number of visible text lines for the control. |
String |
getSelectionDirection()
The direction in which selection occurred.
|
int |
getSelectionEnd()
The index of the end of selected text.
|
int |
getSelectionStart()
The index of the beginning of selected text.
|
int |
getTextLength()
The codepoint length of the control's value.
|
String |
getType()
The string
textarea . |
String |
getValidationMessage()
A localized message that describes the validation constraints that the control does not satisfy (if any).
|
ValidityState |
getValidity()
The validity states that this element is in.
|
String |
getValue()
The raw value contained in the control.
|
String |
getWrap()
Reflects the
wrap
HTML attribute, indicating how the control wraps text. |
boolean |
isAutofocus()
Reflects the
autofocus
HTML attribute, indicating that the control should have input focus when the page loads |
boolean |
isDisabled()
Reflects the
disabled
HTML attribute, indicating that the control is not available for interaction. |
boolean |
isReadOnly()
Reflects the
readonly
HTML attribute, indicating that the user cannot modify the value of the control. |
boolean |
isRequired()
Reflects the
required
HTML attribute, indicating that the user must specify a value before submitting the form. |
boolean |
isWillValidate()
Indicates whether the element is a candidate for constraint validation.
|
void |
select()
Selects the contents of the control.
|
void |
setAutofocus(boolean arg) |
void |
setCols(int arg) |
void |
setCustomValidity(String error)
Sets a custom validity message for the element.
|
void |
setDefaultValue(String arg) |
void |
setDirName(String arg) |
void |
setDisabled(boolean arg) |
void |
setMaxLength(int arg) |
void |
setName(String arg) |
void |
setPlaceholder(String arg) |
void |
setReadOnly(boolean arg) |
void |
setRequired(boolean arg) |
void |
setRows(int arg) |
void |
setSelectionDirection(String arg) |
void |
setSelectionEnd(int arg) |
void |
setSelectionRange(int start,
int end)
Selects a range of text, and sets
selectionStart and selectionEnd . |
void |
setSelectionRange(int start,
int end,
String direction)
Selects a range of text, and sets
selectionStart and selectionEnd . |
void |
setSelectionStart(int arg) |
void |
setValue(String arg) |
void |
setWrap(String arg) |
blur, click, focus, getAccessKey, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getBoundingClientRect, getChildElementCount, getChildren, getClassList, getClassName, getClientHeight, getClientLeft, getClientRects, getClientTop, getClientWidth, getContentEditable, getDataset, getDir, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getId, getInnerHTML, getInnerText, getLang, getLastElementChild, getNextElementSibling, getOffsetHeight, getOffsetLeft, getOffsetParent, getOffsetTop, getOffsetWidth, getOnabort, getOnbeforecopy, getOnbeforecut, getOnbeforepaste, getOnblur, getOnchange, getOnclick, getOncontextmenu, getOncopy, getOncut, getOndblclick, getOndrag, getOndragend, getOndragenter, getOndragleave, getOndragover, getOndragstart, getOndrop, getOnerror, getOnfocus, getOninput, getOninvalid, getOnkeydown, getOnkeypress, getOnkeyup, getOnload, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnmousewheel, getOnpaste, getOnreset, getOnscroll, getOnsearch, getOnselect, getOnselectstart, getOnsubmit, getOntouchcancel, getOntouchend, getOntouchmove, getOntouchstart, getOnwebkitfullscreenchange, getOnwebkitfullscreenerror, getOuterHTML, getOuterText, getPreviousElementSibling, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth, getStyle, getTabIndex, getTagName, getTitle, getWebkitdropzone, getWebkitRegionOverflow, hasAttribute, hasAttributeNS, insertAdjacentElement, insertAdjacentHTML, insertAdjacentText, isContentEditable, isDraggable, isHidden, isSpellcheck, isTranslate, querySelector, querySelectorAll, removeAttribute, removeAttributeNode, removeAttributeNS, scrollByLines, scrollByPages, scrollIntoView, scrollIntoView, scrollIntoViewIfNeeded, scrollIntoViewIfNeeded, setAccessKey, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setClassName, setContentEditable, setDir, setDraggable, setHidden, setId, setInnerHTML, setInnerText, setLang, setOnabort, setOnbeforecopy, setOnbeforecut, setOnbeforepaste, setOnblur, setOnchange, setOnclick, setOncontextmenu, setOncopy, setOncut, setOndblclick, setOndrag, setOndragend, setOndragenter, setOndragleave, setOndragover, setOndragstart, setOndrop, setOnerror, setOnfocus, setOninput, setOninvalid, setOnkeydown, setOnkeypress, setOnkeyup, setOnload, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnmousewheel, setOnpaste, setOnreset, setOnscroll, setOnsearch, setOnselect, setOnselectstart, setOnsubmit, setOntouchcancel, setOntouchend, setOntouchmove, setOntouchstart, setOnwebkitfullscreenchange, setOnwebkitfullscreenerror, setOuterHTML, setOuterText, setScrollLeft, setScrollTop, setSpellcheck, setTabIndex, setTitle, setTranslate, setWebkitdropzone, webkitMatchesSelector, webkitRequestFullscreen, webkitRequestFullScreen
addEventListener, addEventListener, appendChild, cloneNode, compareDocumentPosition, contains, dispatchEvent, getAttributes, getBaseURI, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getTextContent, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, removeEventListener, removeEventListener, replaceChild, setNodeValue, setPrefix, setTextContent
boolean isAutofocus()
autofocus
HTML attribute, indicating that the control should have input focus when the page loadsvoid setAutofocus(boolean arg)
int getCols()
cols
HTML attribute, indicating the visible width of the text area.void setCols(int arg)
String getDefaultValue()
void setDefaultValue(String arg)
String getDirName()
void setDirName(String arg)
boolean isDisabled()
disabled
HTML attribute, indicating that the control is not available for interaction.void setDisabled(boolean arg)
FormElement getForm()
int getMaxLength()
maxlength
HTML attribute, indicating the maximum number of characters the user can enter. This constraint is evaluated only when the value changes.void setMaxLength(int arg)
void setName(String arg)
String getPlaceholder()
placeholder
HTML attribute, containing a hint to the user about what to enter in the control.void setPlaceholder(String arg)
boolean isReadOnly()
readonly
HTML attribute, indicating that the user cannot modify the value of the control.void setReadOnly(boolean arg)
boolean isRequired()
required
HTML attribute, indicating that the user must specify a value before submitting the form.void setRequired(boolean arg)
int getRows()
rows
HTML attribute, indicating the number of visible text lines for the control.void setRows(int arg)
String getSelectionDirection()
void setSelectionDirection(String arg)
int getSelectionEnd()
void setSelectionEnd(int arg)
int getSelectionStart()
void setSelectionStart(int arg)
int getTextLength()
String getType()
textarea
.String getValidationMessage()
ValidityState getValidity()
String getValue()
void setValue(String arg)
boolean isWillValidate()
void setWrap(String arg)
boolean checkValidity()
invalid
event at the control. It returns true if the control is not a candidate for constraint validation, or if it satisfies its constraints.void select()
void setCustomValidity(String error)
void setSelectionRange(int start, int end)
selectionStart
and selectionEnd
. If either argument is greater than the length of the value, it is treated as pointing to the end of the value. If end
is less than start
, then both are treated as the value of end
.void setSelectionRange(int start, int end, String direction)
selectionStart
and selectionEnd
. If either argument is greater than the length of the value, it is treated as pointing to the end of the value. If end
is less than start
, then both are treated as the value of end
.Copyright © 2016. All rights reserved.