HTMLTextAreaElement

The textarea element is represented by the HTMLTextAreaElement object. It defines the methods and properties described in the following table.

NameDescriptionReturns
autofocusthe autofocus attributeboolean
checkValidity()Performs input validation on the elementboolean
colsthe cols attributenumber
dirNamethe dirName attributestring
disabledthe disabled attributeboolean
focusset the focus to the textarea controlvoid
formReturns the form that this element is associated withHTMLFormElement
labelsReturns the label elements associated with this elementHTMLLabelElement[]
maxLengththe maxlength attributenumber
namethe name attributestring
placeholderthe placeholder attributestring
readOnlythe readonly attributeboolean
requiredthe required attributeboolean
rowsthe rows attributenumber
setCustomValidity(<msg>) Sets a custom validation messagevoid
textLengthReturns the length of the value attributenumber
typeReturns textareastring
validationMessageReturns the error message that would be shown to the user if input validation was appliedstring
valueReturns the content of the elementstring
willValidateReturns true if the element will be subject to input validation when the form is submitted; returns false otherwiseboolean
wrapthe wrap attributestring
Home 
  JavaScript Book 
    DOM  

HTMLTextAreaElement:
  1. HTMLTextAreaElement
  2. focus: set the focus to the textarea control