7.Disable the button 1 help me!


#1

I did the code as it sayed i checked the hint and its the same. But still it is saying "Oops, try again. Make sure you have defined all the variables!"

I dont know what i did wrong here is my code:

var main = function() {
    $('.btn').click(function() {
        var post = $('.status-box').val();
        $('<li>').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);
        
        if(charactersLeft < 0) {
            $('.btn').addClass('disabled');
        }
        else if(characterLeft == 140) {
            $('.btn').addClass('disabled');
        }
        else {
            $('.btn').removeClass('disabled');
        }       
    });
    
    $('.btn').addClass('disabled');
    
};

$(document).ready(main);

#2

must be "charactersLeft", not "characterLeft"... there is a missing "s" before "Left"
in this part of the code
else if(characterLeft == 140) {
$('.btn').addClass('disabled');
}