HTML CSS Bootstrap Javascript Icons Python
HTML References
HTML - Tag Reference HTML - Tag by Category HTML - Attributes HTML - Global Attributes HTML - Events HTML - Language Codes HTML - Country Codes HTML - URL Encoding HTTP Methods HTTP Status Codes <input> types
All HTML Tags
<!-- --> <!DOCTYPE> <a> <abbr> <acronym> <address> <applet> <area> <article> <aside> <audio> <b> <base> <basefont> <bdi> <bdo> <big> <blockquote> <body> <br> <button> <canvas> <caption> <center> <cite> <code> <col> <colgroup> <data> <datalist> <dd> <del> <details> <dfn> <dialog> <dir> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <font> <footer> <form> <frame> <frameset> <h1> - <h6> <head> <header> <hr> <html> <i> <iframe> <img> <input> <ins> <kbd> <label> <legend> <li> <link> <main> <map> <mark> <meta> <meter> <nav> <noframes> <noscript> <object> <ol> <optgroup> <option> <output> <p> <param> <picture> <pre> <progress> <q> <rp> <rt> <ruby> <s> <samp> <script> <section> <select> <small> <source> <span> <strike> <strong> <style> <sub> <summary> <sup> <svg> <table> <tbody> <td> <template> <textarea> <tfoot> <th> <thead> <time> <title> <tr> <track> <tt> <u> <ul> <var> <video> <wbr>

HTML <textarea> tag

The HTML <textarea> element represents a multi-line text input control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form.

Run code

The rows and cols attributes allow you to specify an exact size for the textarea to take.

Note: The size of a textarea can also be set by the CSS height and width properties.

Browser compatibility

The <textarea> element is fully supported by all browsers:

<textarea> yes yes yes yes yes


The following table shows the attributes that are specific to the <textarea> tag:

HTML5 is new in HTML5

Attribute Value Description
autofocus - The textarea should be automatically focused after the page loaded
cols number Specifies the visible width of a textarea, in average character widths
disabled - Indicates whether the user can interact with the textarea
form Indicates the form that is the owner of the textarea
maxlength number Defines the maximum number of characters allowed in the textarea
name text Specifies the name of a textarea element
placeholder text Provides a hint to the user of what can be entered in the textarea
readonly - Specifies whether the textarea can be edited
required - Indicates whether the textarea is required to fill out or not
rows number Specifies the number of rows in a textarea
wrap hard
Indicates whether the text should be wrapped

Global Attributes

The <textarea> tag supports the global attributes described in HTML Global Attributes Reference

Event Attributes

The <textarea> tag supports the event attributes described in HTML Events Reference

More Examples

In many browsers, <textarea> elements are resizable by default. You may override this behavior with the CSS resize property:

Run code

Last updated: Monday 01 Oct, 2018