Textarea Maxlength Counter
(function maxLength(){
$('.js-maxlength').on('input', function(){
var $textarea = $(this),
maxLength = $textarea.attr('maxlength'),
counterSelector = $textarea.data('maxlength-counter');
$(counterSelector).text(maxLength - $textarea.val().length);
});
})();
<textarea class="js-maxlength" data-maxlength-counter="#js-message-counter" maxlength="100"></textarea>
You have <strong id="js-message-counter" class="text-primary">100</strong> characters left.