Latest web development tutorials

HTML textarea required attributes

HTML textarea tag Reference Manual HTML <textarea> tag

Examples

Form with the required text area:

<form action="demo-form.php">
<textarea name="comment" required></textarea>
<input type="submit">
</form>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

In addition to Internet Explorer and Safari, the other major browsers support the required properties.


Definition and Usage

required attribute is a Boolean attribute.

required attribute specifies a text area is required / Required (to submit the form).


Differences between HTML 4.01 and HTML5

required attribute is new in HTML5 attributes.


Differences between HTML and XHTML

In XHTML, prohibit attribute minimization, required attributes must be defined as <textarea required = "required">.


grammar

<textarea required>


HTML textarea tag Reference Manual HTML <textarea> tag