What is the correct syntax for 7/9?


#1

Hi there. been at this one for days trying to figure out where the syntax here is wrong. I see this post, and the correct syntax is exactly what I had without the = sign error. Have painstakingly gone over every line several times to no avail. perhaps you could help.

$('.status-box').keyup(function() {
        var postlength = $(this).val().length;
        var charactersleft = 140 - postlength;
        $('.counter').text(charactersleft);
        
        if(charactersleft < 0){
            $('.btn').addclass('disabled');
        }
        else if(charactersleft == 140) {
            $('.btn').addclass('disabled');
        }
        else {
            $('.btn').removeclass('disabled');
        }
            
    });
    
    $('.btn').addclass('disabled');
    
}


$(document).ready(main);

7/9 Disable the button 1 problem
#2

sorry, last was incomplete

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(charactersleft == 140) {
            $('.btn').addclass('disabled');
        }
        else {
            $('.btn').removeclass('disabled');
        }
            
    });
    
    $('.btn').addclass('disabled');
    
}

#3

should be, prependTo

Check if the author asks for, postLength.

Check if the author asks for, charactersLeft.

should be, addClass.

should be, removeClass.