Advertisement
Home Open Editor ❯

HTML <textarea> required Attribute

Example

<form action="action.php">
  <textarea required name="textareaText"></textarea>

  <input type="submit" value="Submit">
</form>

Try this code ❯

Meaning

The required attribute specifies that the user is required to provide a value for the <textarea> tag for the form to be submitted.

User agents that understand this should set the CSS pseudo-class :invalid when the field goes into error.


Standard Syntax

HTML: <textarea required>...</textarea>

XHTML: <textarea required="required">...</textarea>


Advertisement

Attribute Values

Value Description
required This is a boolean attribute, the presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.
Home Open Editor ❯
Advertisement