I'm having trouble with 5. update the '.counter'

jquery

#1

Hi, Im not sure what I'm doing wrong. It keeps saying "Oops, try again. Remember to update the '.counter' to show how many characters are left".
Here's my code
var main = function() {
$('.btn').click(function() {
var post = $('status-box').val();
$('

  • ').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);

    Please help


  • #2

    Hi Josh,

    On line 6, you need to remove the closing curly brace (}), and on line 11, you need to select .counter - you're missing the dot (.) :)


    #3

    That works. I've been stuck on that for a while. Thank you