Follow the code:
Html:
<textarea id="summernote">Escrever aqui</textarea>
<h5 id="limite_vermelho" style="text-align:right;color:red"></h5>
<h5 id="limite_normal" style="text-align:right"></h5>
JS:
$('#summernote').on('summernote.keyup', function(e) {
debugger;
var text = $(this).next('.note-editor').find('.note-editable').text();
var length = text.length;
var num = 10 - length;
if (length > 10) {
$('#limite_normal').hide();
$('#limite_vermelho').text(10 - length).show();
}
else{
$('#limite_vermelho').hide();
$('#limite_normal').text(10 - length).show();
}
});
Or if you prefer in jsfiddle: link
It can not enter more than 10 characters, how can I do this with jquery?