I get a reminder to update the "counter". Please advise what I have done wrong


#1


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 this line

$("status-box").keyup(function()

it's missing the dot to "status-box" should be ".status-box"


#3

Thanks- now it's all fixed!


#4

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