Languages
[Edit]
EN

HTML - multiline input (textarea)

3 points
Created by:
Elias999
489

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

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