I\'m trying to do a simple auto-expanding textarea. This is my code:
textarea.onkeyup = function () { textarea.style.height = textarea.clientHeight + \'px\
For those interested in a jQuery version of Rob W's solution:
var textarea = jQuery('.textarea'); textarea.on("input", function () { jQuery(this).css("height", ""); //reset the height jQuery(this).css("height", Math.min(jQuery(this).prop('scrollHeight'), 200) + "px"); });