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();
$('

  • ').text(post).prependTo('.posts');
    $('.status-box').val('140');
    }
    }
    $('.status-box').keyup(function() {
    var postLength = $(this).val().length;
    var charactersLeft = 140 - postLength;
    $('.counter').text(charactersLeft);
    });
    }
    $(document).ready(main);

  • #2

    @designninja16914,

    Your btn =click= Eventhandler should look like

    $('.btn').click(function() {
        var post = $('status-box').val();
        $('<li>').text(post).prependTo('.posts');
        $('.status-box').val('140');
     });