Search results

ITextAreaElement

Properties

autofocus

boolean

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.

cols

number

Sets or retrieves the width of the object.

defaultValue

string

Sets or retrieves the initial contents of the object.

form

HTMLFormElement | null

Retrieves a reference to the form that the object is embedded in.

maxLength

number

Sets or retrieves the maximum number of characters that the user can enter in a text control.

name

string

Sets or retrieves the name of the object.

placeholder

string

Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.

readOnly

boolean

Sets or retrieves the value indicated whether the content of the object is read-only.

required

boolean

When present, marks an element that can’t be submitted without a value.

rows

number

Sets or retrieves the number of horizontal rows contained in the object.

selectionEnd

number

Gets or sets the end position or offset of a text selection.

selectionStart

number

Gets or sets the starting position or offset of a text selection.

type

string

Retrieves the type of control.

validationMessage

string

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.

validity

ValidityState

Returns a ValidityState object that represents the validity states of an element.

value

string

Retrieves or sets the text in the entry field of the textArea element.

willValidate

boolean

Returns whether an element will successfully validate based on forms validation rules and constraints.

wrap

string

Sets or retrieves how to handle wordwrapping in the object.

Methods

checkValidity

Returns whether a form will validate when it is submitted, without having to submit it.

Returns boolean

select

Highlights the input area of a form element.

Returns void

setCustomValidity

Sets a custom error message that is displayed when a form is submitted.

Parameter Type Description
error string Sets a custom error message that is displayed when a form is submitted.

Returns void

setSelectionRange

Sets the start and end positions of a selection in a text field.

Returns void