HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Textarea Object : Change the number of visible rows for a text area
The rows property sets or returns the value of the rows attribute of a text area.
The rows attribute specifies the height (visible number of lines) in a text area.
Property | |||||
---|---|---|---|---|---|
rows | Yes | Yes | Yes | Yes | Yes |
Return the rows property:
Set the rows property:
Value | Description |
---|---|
number | Specifies the visible number of rows in the text area |
Return Value: | A Number, representing the height of the text area, in characters |
---|
Get the height of a text area, in characters:
var x = document.getElementById("myTextarea").rows;
Change the height of a text area using the style.height property:
document.getElementById("myTextarea").style.height = "250px";
Change the height and width of a text area using the cols and rows properties:
document.getElementById("myTextarea").rows = "10";
document.getElementById("myTextarea").cols = "100";
Change the height and width of a text area using the style.width and style.height properties:
document.getElementById("myTextarea").style.height = "100px";
document.getElementById("myTextarea").style.width = "500px";
HTML reference: HTML <textarea> rows attribute
❮ Textarea Object