Skip to content

Instantly share code, notes, and snippets.

@webinmd
Created June 20, 2018 07:18
Show Gist options
  • Save webinmd/0c06ccbd8cb91311a45836fc4e39d2fc to your computer and use it in GitHub Desktop.
Save webinmd/0c06ccbd8cb91311a45836fc4e39d2fc to your computer and use it in GitHub Desktop.
<textarea name="message" data-max="50" ></textarea>
$('.symbol-count').keyup(function () {
var max = $(this).data('max');
var len = $(this).val().length;
$(this).closest('form').find('.symbol-count').find('span').text(len);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment