Having an error with 'Count characters left'


#1



Hi guys, I keep running into an error in this lesson, and I cannot for the life of me seem to figure out where my mistake is, any help would be appreciated!

https://www.codecademy.com/courses/web-beginner-en-hk5qh/0/5?content_from=make-an-interactive-website%3Ajquery-dom-manipulation


"Oops, try again. Remember to update the '.counter' to show how many characters are left."


 var main = function() {
  $(".btn").click(function() {
      var post = $(".status-box").val();
      $("<li>").text(post).prependTo(".posts");
      $('.status-box').val("");
      }
      
      $('.status-box').keyup(function() {
          var postlength = $(this).val().length;
          var charactersleft = 140 - postLength;
          $('.counter').text(CharactersLeft);
      });
}

$(document).ready(main);


#2

Hi @cmjlee3,

Check your spelling of each variable when you create it, and when you use it.


#3

Hey, thanks so much for your response! I'm actually still not sure where the spelling mistake is, maybe i'm just completely missing it. :confused:


#4

@cmjlee3 Capitalization counts as spelling, here.

Look specifically at lines 9, 10, and 11.


#9

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.