How to limit characters on mouse paste event in javascript
<textarea id="Description"></textarea>
<script>
$(document).ready(function() {
$('#Description').bind('keyup change input', function() {
var characterLimit = 10;
var charactersUsed = $(this).val().length;
if (charactersUsed > characterLimit) {
charactersUsed = characterLimit;
$(this).val($(this).val().substr(0, characterLimit));
$(this).scrollTop($(this)[0].scrollHeight);
}
});
});
</script>