limit textarea characters in javascript

limit textarea characters in javascript:

padding:0px 10px;
font-family:arial black;
function limitText(v){
    len = v.length;
var s = document.testForm.Msg.value;
c = 10 - len;
    if(len > 10){
    m = s.substr(0,10);
    document.testForm.Msg.value = m;
    c = 0;
    document.testForm.count.value = c;
<form name='testForm'>
<textarea cols='35' rows='6' name='Msg' class='y' onkeyup="javascritp:limitText(this.value);"></textarea>
<input type='button' class='x' name='count' value='10' />



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s