<textarea>: The HTML Textarea Element

I. Description

The HTML <textarea> element is used to create a large element which users may use to input text. The <textarea> element should be used when the <input> element would be insufficiently small.

The <input> element is most suitable for small amounts of text such as passwords, usernames, or a few words. The <textarea> element should be used when you want to allow users to submit a large amount of text such as a few sentences to multiple paragrahps and hundreds of words.

II. Examples

<!DOCTYPE html>
<html>
    <head>
        <title>Textarea element example</title>
    </head>
    <body>
        <h1>Textarea example</h1>
        <form id="comment_submit" method="POST" action="/api/account/comment/create">
            <label for="comment"></label>
            <textarea name="comment" id="comment" placeholder="Comment"></textarea>
            <button type="submit">Submit Comment</button>
        </form>
    </body>
</html>

This document was last updated: