Multiline text boxes

Multiline text boxes

If a single-line text field doesn’t offer enough room for a response, create a text box instead of a text field:

  • The <textarea> element defines the box and its parameters.
  • The rows attribute specifies the height of the box in rows based on the font in the text box.
  • The cols attribute specifies the width of the box in columns based on the font in the text box.

The text that the user types into the box provides the value, so you need only give the box a name with the name attribute:https://stackblitz.com/edit/web-platform-unhenc?embed=1&file=index.html&hideDevTools=1&hideExplorer=1&hideNavigation=1

Any text you include between the <textarea> and </textarea> tags appears in the text box in the browser. The user then enters information in the text box and overwrites your text.