Status update-->5.Count characters left


#1



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

I have done everything I believe is right and checker over and over again, but I still get the same message saying "Remember to update the '.counter' to show how many characters are left." and I do not know what to do.

Replace this line with your code. 
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

Check on all of your opening and closing curly braces. For this to work, you need your click and keyup functions to be inside your main function.


#3

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