English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Reference

HTML: <textarea> required attribute

The required attribute of <textarea> is a boolean attribute. The required attribute specifies that/must fill in a text area (to submit the form).

 HTML <textarea> tag

Online Example

Form with a required text field:

<form action="action_page.php">
  <textarea name="comment" required></textarea>
  <input type="submit">
</form>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Except for Internet Explorer and Safari, other mainstream browsers support the required attribute.

Definition and Usage

The required attribute is a boolean attribute.

The required attribute specifies that/must fill in a text area (to submit the form).

HTML 4.01 and HTML5differences

The required attribute is an HTML5 new attributes.

Differences between HTML and XHTML

In XHTML, attribute shorthand is prohibited, the required attribute must be defined as <textarea required="required">.

Syntax

<textarea required>
 HTML <textarea> tag