html - Can I make a textarea grow with text to a max height? -


i'm working on project have data in divs can various sizes. when user clicks on 1 of divs, needs turn editable textarea. width constant, i'd height start height of original div , grow max height before adding scrollbar. possible?

you can use contenteditable , let user input in straight div, here's demo: http://jsfiddle.net/gd5jy/

html

<div contenteditable>     type here... </div> 

css

div[contenteditable]{     border: 1px solid black;     max-height: 200px;     overflow: auto; } 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -