99 . By default, it creates a textarea with rows=2 and cols=20. Some developers also use cols and rows css property to provide textarea size. The HtmlHelper class includes two extension methods to render multi-line . Using width: 100% I added the following line to your javascript function, setting the width of div to the width of the textArea element prior to resizing the height of the textArea: divHidden.style.width = element.getBoundingClientRect().width + ‘px’; The content of this element represents the initial value of the control. maxlength: number: Specifies the maximum number of characters in textarea. width: 100px; If you want to increase the element width, you can do it by . textarea controls are useful to collect or edit long runs of text like messages, files' contents, lists, reviews, articles, etc.. Now you can use height and width property to provide a fixed height and width to the element. The CSS max-width: 300px; max-height:300px Demo on jsfiddle. readonly: readonly To prevent a text field from being resized, you can use the CSS resize property with its "none" value. The control associated to this field is a text box that allows users to edit multiple lines of plain text. Description. By default, text in a /form > … textarea { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; width: 100%; } View Demo Setting the box-sizing to border-box allows the textarea to respect its parent container's padding and border, recalculating what 100% actually means. We can make any element editable and input-like with the contenteditable attribute: 99 . By default, it creates a textarea with rows=2 and cols=20. Some developers also use cols and rows css property to provide textarea size. The HtmlHelper class includes two extension methods to render multi-line . Using width: 100% I added the following line to your javascript function, setting the width of div to the width of the textArea element prior to resizing the height of the textArea: divHidden.style.width = element.getBoundingClientRect().width + ‘px’; The content of this element represents the initial value of the control. maxlength: number: Specifies the maximum number of characters in textarea. width: 100px; If you want to increase the element width, you can do it by . textarea controls are useful to collect or edit long runs of text like messages, files' contents, lists, reviews, articles, etc.. Now you can use height and width property to provide a fixed height and width to the element. The CSS max-width: 300px; max-height:300px Demo on jsfiddle. readonly: readonly To prevent a text field from being resized, you can use the CSS resize property with its "none" value. The control associated to this field is a text box that allows users to edit multiple lines of plain text. Description. By default, text in a