Interactive website:Status update -can't find the problem - Oops, try again. Remember to update the '.counter' to show how many characters are left


#1

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

#2

Please post a link to this exercise so we can test your code. We need the exact page you are on. Thank you.


#3

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


#4

Hey , can you help me ?! I got you the link and I'm waiting ...


#5

Somebody dug up a fibreoptics cable 100 kilometers from here and the whole of rural northern Alberta was without internet since this morning. I've only just got back online. Sorry for the delay.

Now, what is the problem you are experiencing? Are you getting any error messages in the editor or console?


#6

I get the error message in a red box under the code , "Oops, try again. Remember to update the ‘.counter’ to show how many characters are left"
I tried a lot of changes , can't figure it out .


#7

Are you running the code,

$(document).ready(main):

?
I've tested your code and it does work as expected, and passes this exercise.


#8

Didn't think of that cause it worked without it in the previous exercises .
Thanks you !