Open In App

How to create a multiline input control text area in HTML5 ?

The HTML <textarea> tag is used to specify a multiline input control text area in HTML5.  The <cols> and <rows> attributes specify size of a textarea.

Syntax



<textarea rows="" cols=""> Contents... </textarea>

The <textarea> tag contains 5 attributes that are listed below:

Example 1:



In this example, we will set the rows, and cols attribute to create a multiline control input textarea.




<!DOCTYPE html>
<html>
 
<body>
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
    <textarea rows="10" cols="20">
        welcome to GeeksforGeeks Aman Rathod.
        A perfect Portal for Geeks
    </textarea>
</body>
 
</html>

Output:

Example 2: In this example, we will set the number of characters allowed in the input textarea.




<!DOCTYPE html>
<html>
 
<body>
    <h1 style="color:green;">
      GeeksforGeeks
    </h1>
    <textarea minlenght="100" maxlength="300"
        placeholder="Give Feedback here">
    </textarea>
</body>
 
</html>

Output: 

 


Article Tags :