DOM
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.
Documentation for this class was provided by
MDN.
- var autofocus : Bool
Reflects the
autofocus
HTML attribute, indicating that the control should have input focus when the page loads
- var cols : Int
Reflects the
cols
HTML attribute, indicating the visible width of the text area.
- var defaultValue : String
- The control's default value, which behaves like the textContent property.
- var dirName : String
- var disabled : Bool
Reflects the
disabled
HTML attribute, indicating that the control is not available for interaction.
- var form(default,null) : FormElement
The containing form element, if this element is in a form. If this element is not contained in a form element:
- var labels(default,null) : NodeList
- A list of
<label>
elements that are labels for this element. - var maxLength : Int
Reflects the
maxlength
HTML attribute, indicating the maximum number of characters the user can enter. This constraint is evaluated only when the value changes. Setter throws DOMException.
- var name : String
Reflects
name
HTML attribute, containing the name of the control.
- var placeholder : String
Reflects the
placeholder
HTML attribute, containing a hint to the user about what to enter in the control.
- var readOnly : Bool
Reflects the
readonly
HTML attribute, indicating that the user cannot modify the value of the control.
- var required : Bool
Reflects the
required
HTML attribute, indicating that the user must specify a value before submitting the form.
- var rows : Int
Reflects the
rows
HTML attribute, indicating the number of visible text lines for the control.
- var selectionDirection : String
- The direction in which selection occurred. This is "forward" if selection was performed in the start-to-end direction of the current locale, or "backward" for the opposite direction. This can also be "none" if the direction is unknown."
- var selectionEnd : Int
- The index of the end of selected text.
HTML5 If no text is selected, contains the index of the character that follows the input cursor. On being set, the control behaves as if setSelectionRange() had been called with this as the second argument, and selectionStart as the first argument.
- var selectionStart : Int
- The index of the beginning of selected text.
HTML5 If no text is selected, contains the index of the character that follows the input cursor. On being set, the control behaves as if setSelectionRange() had been called with this as the first argument, and selectionEnd as the second argument.
- var textLength(default,null) : Int
- The codepoint length of the control's value.
- var type(default,null) : String
- The string
textarea
. - var validationMessage(default,null) : String
- A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (willValidate is false), or it satisfies its constraints.
- var validity(default,null) : ValidityState
- The validity states that this element is in.
- var value : String
- The raw value contained in the control.
- var willValidate(default,null) : Bool
- Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.
- var wrap : String
Reflects the
wrap
HTML attribute, indicating how the control wraps text.
- function checkValidity() : Bool
- function select() : Void
- function setCustomValidity(error : String) : Void
- function setRangeText(replacement : String, start : Int, end : Int, selectionMode : String) : Void
- Throws DOMException.
- function setSelectionRange(start : Int, end : Int, ?direction : String) : Void