/* Create a new variable with the height of each line in pixels, 15. Tip: You can also use the can the rows and columns of a textarea element with an id be changed on the fly ? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith thanks & prais. Poorly conditioned quadratic programming with "simple" linear constraints. Follow Post Reply. in your HTML you can define the number of rows to be displayed. aaaaaa asked on 10/10/2006 how to dynamic textarea rows? How to get image size (height & width) using JavaScript? This just creates a textarea with one row. Create a textarea and the task is to automatically resize it when we type or paste the content in it. Asking for help, clarification, or responding to other answers. in your HTML you can define the number of rows to be displayed. How can you prove that a certain file was downloaded from a certain website? There was a problem preparing your codespace, please try again. 4 . Browser Support Syntax <textarea cols=" number "> Attribute Values HTML <textarea> tag Did Great Valley Products demonstrate full motion video on an Amiga streaming from a SCSI hard disk in 1990? The code should be: @Html.TextAreaFor (model => model.Comments, 10, 40, null); [no name] 21-May-13 16:41pm. Let's see this solution in use. @Html.TextArea() Html.TextArea is loosely typed text input control that takes string as parameter. And the rows are added so on on "Add Row" button click. But the default height is 32px rather than 16px how do I change that. The rows attribute specifies the height (visible number of lines) in a text area. A rows attribute on a <textarea> element. style.height properties: HTML reference: HTML