Here Mudassar Ahmed Khan has provided code snippet to restrict the length of the input in HTML TEXTAREA control
<textarea class = "max10" rows = "3" cols = "20"></textarea>
<textarea class = "max5" rows = "3" cols = "20"></textarea>
 
<script type = "text/javascript" src = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.min.js"></script>
<script language="javascript" type="text/javascript">
    //Restrict text while typing
    $("textarea[class*=max]").live("keypress", function () {
        var maxLength = $(this).attr("class").replace("max", "");
        return $(this).val().length <= maxLength - 1;
    });
    $(document).ready(function () {
        //Truncate Text on paste
        $("textarea[class*=max]").bind('paste', function () {
            var textarea = $(this);
            var maxLength = textarea.attr("class").replace("max", "");
            setTimeout(function () {
                textarea.val(textarea.val().substring(0, maxLength));
            }, 100);
        });
    });
</script>
 
 
Explanation:
The above script searches for class with keyword “max”. It then extracts the integer value (here 10) and then uses it to set Max Length for the HTML TEXTAREA control.
Note: It is important to attach the “paste” event using bind as live does work for paste event in Internet Explorer 8