在单个页面上添加多个字符计数时出现问题。如果不使用相同脚本的多行,我将如何允许多个限制?
https://jsfiddle.net/r7c3754j/1/
var text_max = 80;
$('#character_count').html(text_max + ' remaining');
$('#text_area').keyup(function() {
var text_length = $('#text_area').val().length;
var text_remaining = text_max - text_length;
$('#character_count').html(text_remaining + ' remaining');
});