rows property (textarea)
Sets or retrieves the number of visible rows within a textarea element.
The height is calculated by the average character heights. You can set the dimensions of textarea with the width and the height style properties.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: rows |
Possible values:
Integer that sets or retrieves the number of visible rows.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the rows attribute:
|
||||
<textarea rows="3">Some text content</textarea> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the rows property:
|
||||
<head> <script type="text/javascript"> function SetRows () { var input = document.getElementById ("myInput"); var textArea = document.getElementById ("myTxtArea"); textArea.rows = input.value; } </script> </head> <body> <textarea id="myTxtArea" rows="3">Some text content</textarea> <br /> <input id="myInput" type="text" value="6" /> <button onclick="SetRows ();">Set the number of rows!</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
HTML elements:
Related pages:
External links:
User Contributed Comments