6. Reset the counter


#1

I keep getting the term : " Oops, try again. Remember to update the '.counter' to show how many characters are left "
Can anyone help me with what I'm doing wrong with the code??

var main = function() {
};

$('btn').click(function) {
var post = $('.status-box'). val();
$('

  • ').text(post).prependTo('posts');
    $('.status-box').val();
    $('.counter').text('140');
    });
    };

    $('.status-box').keyup(function) {
    var postLength = $(this).val().length;
    var charactersLeft = 140 - postLength;
    $('.counter').text(charactersLeft);
    });

    $(document).ready(main);


  • #2

    @frederikkepape
    Look closer at your code:

    You closed the function immediately so the code you wrote below doesn't belong to the function!


    Your $(") is empty and has no class.

    Remove your };. It doesn't close anything.
    Hope this helped you!


    #3

    Thank you!
    It helped :slightly_smiling: