Elastic textarea using jQuery
<p>I attempted to make my own elastic textarea code for practice. This is what I currently have</p>

<pre><code>$(".textareaField").keyup(function() {
    var height = $(this).height();

    var lines = $(this).val().split('\n');
    var line_count = lines.length;
    var total_lines = 8;

    if(total_lines &lt; line_count) {
        $(this).animate({
            "height" : (line_count * 25)
        }, 200);
    } else {
        $(this).animate({
            "height" : 200
        }, 200);
    }
});
</code></pre>

<p><code>total_lines</code> is the number of lines possible in that textarea, its 8 because the initial height of textarea is 200 px and line-height is 25 px. 200/25 = 8 lines possible on initial config. What I want to achieve is to shorten the textarea when the user deletes couple of lines, and stop reducing the height at 8 lines (200 px).</p>
