HTML <textarea> requiredAttribute
Examples
A form with a required text area:
<form action="demo-form.php">
<textarea name="comment" required></textarea>
<input type="submit">
</form>
<textarea name="comment" required></textarea>
<input type="submit">
</form>
Try it yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
Except Internet Explorer and Safari, all other major browsers support the required attribute.
Definition and Usage
The required attribute is a boolean attribute.
The required attribute specifies that a text area is required/must be filled in (to submit the form).
Differences between HTML 4.01 and HTML5
The required attribute is new in HTML5.
Differences between HTML and XHTML
In XHTML, attribute minimization is forbidden, and the required attribute must be defined as <textarea required="required">.
Syntax
<textarea required>
HTML <textarea> tag Other extensions