js counter for character