How to auto increase height of textarea when you are typing

How to auto increase height of textarea when you are typingTextarea is html tag to get the multiple line text value in the form we used in the web page. In that it will have the particular height only. If you type the text more that the height of the textarea it will show the scroll bar at the right side. You scroll and see the value in the textarea. In that we want to increase the height of the textarea when you type.

You can do this with javascript and jQuery. Here I give the jquery code. Using this you can it increase the height of the textarea automatically when the user type in the textarea.

$('textarea').keydown(function() {
var txhe = this;
setTimeout(function () {
txhe.style.cssText = 'height:auto; padding:0';
txhe.style.cssText = 'height:' + txhe.scrollHeight + 'px';
}, 0);
})
Copyright Labw3