title: Restrict the user to paste max (40 ) Characters in textarea
body: <p>I am restricting the user to enter a max limit(40Char) of characters in a text area.
  I am Calling this below <code>JS</code> function on <code>onKeyUp</code> event of <code>textarea</code>.</p>
  
  <p>But when <strong>i copy paste a content which is more than 40chars</strong>, not gettinng pop-up(Alert) until i do a keyup/down on the textarea.</p>
  
  <pre><code>function checkLength(textBox, e, maxLength) {
    if (textBox.value.length &gt; maxLength - 1) {        
       alert("* You have reached max limit ");
       textBox.value = textBox.value.substr(0, maxLength);
    }
    else {
       alert(maxLength - textBox.value.length + " characters remaining");
    }
  }
  </code></pre>
  
  <p>Is there a way to get alert without <code>keyup/down</code> after pasting into <code>textarea</code>?</p>