I want to prevent the user from entering more than 100 characters into a textarea. I already wrote the code that will detect when the user's post reaches 100 characters. But I have no idea how to prevent him from typing any more beyond that point:
$(document).ready(function(){
$('.comment').keyup(function(){
var count = this.value.length;
if (count > 100) {
// what goes here???
}
});
});
<textarea class="comment" rows="10" cols="30"></textarea>