Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

HTML <textarea> required Attribute

❮ HTML <textarea> tag

Example

A form with a required text area:

<form action="/action_page.php">
  <textarea name="comment" required></textarea>
  <input type="submit">
</form>
Try it Yourself »

Definition and Usage

The required attribute is a boolean attribute.

When present, it specifies that a text area is required/must be filled out (in order to submit the form).


Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Attribute
required Yes 10.0 4.0 Yes Yes

Syntax

<textarea required>

❮ HTML <textarea> tag