Код: Выделить всё
$(".note-editable").each(function(){
$(this).on("keyup", function(){
var cc = $(this).text().length;
var arr = $(this).next().attr("class").split('_');
var q = "q"+arr[0];
var maxChar = arr[2];
var textarea = $('*[name^="'+q+'"]');
var diffChar = parseInt(maxChar - cc);
if(diffChar >= 0)
{
$(this).next().text(diffChar + " Remaining out of " + maxChar);
}
else
{
$(this).next().text("0 Remaining out of " + maxChar);
//$(textarea).prop('disabled', true);
$(this).text($(this).text().slice(0,diffChar));
}
});
});
Спасибо!!!
Подробнее здесь: https://stackoverflow.com/questions/337 ... ummernotes
Мобильная версия