Here I'm using onPaste
event :-
$(document).on("paste", ".txtQuestion", function (event e)
if ( $(".txtQuestion").val().length >= 10) {
e.preventDefault();
$(".txtQuestion").addClass("error");
return false;
}
else {
$(".txtQuestion.error").removeClass("error");
}
});