I count characters using NobleCount and the following code:
$(\'#message\').NobleCount(\'#messageInfo\',{ max_chars: getMaxChars(), o
$(function() { $('#message').keydown(function() { var mychars = $('#message').val().length; var mysms = Math.ceil(mychars / 160); console.log (mysms); console.log (mychars +'' + ' characters'); }); });