Languages
[Edit]
EN

HTML - multiline input (textarea)

3 points
Created by:
Elias999
579

In this article, we would like to show you how to create multiline input in HTML.

There is not available multiline input in HTML, as multiline input we need to use textarea.

Quick solution:

// ONLINE-RUNNER:browser;

<textarea name="textarea-name" cols="30" rows="3"></textarea>

Where:

  • cols¬†- number of visible¬†characters width of the textarea¬†- it is average¬†characters width (if not specified, the default value is 20),
  • rows -¬†number of visible text lines.

 

Practical example

cols and rows attributes are optional and we can use CSS style with width and height values.

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<body>
  <textarea name="textarea" cols="30" rows="5">Type something here...</textarea>
</body>
</html>

References

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

HTML - input element types

Native Advertising
ūüöÄ
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

‚̧ԳŹūüíĽ ūüôā

Join