JavaScript > Expanding a articles: • Automatically adding rows or expanding a textarea as you type so you can always see all the text
|
Return to index of articles
Automatically adding rows or expanding a textarea as you type so you can always see all the text
Category: JavaScript
Category: Expanding a
Background
As part of the user requirements for a web-based application I was working on, the user asked if the text boxes they typed in could automatically expand as they type, so they could always see what they had previously typed without having to scroll up. A quick search of the web reveals this Internet Explorer-only solution:
This code will automatically set the height of the textarea to the "scrollheight" whenever the text in the textarea changes, thereby making it expand by adding rows as you type.
10/6/2004
Source: Visit
|