L7 make sure you define all the variables? need help


#1

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');
    };
    
    
$(document).ready(main);

Make sure you have defined all the variables!


#2

Hi Jzhang718,

You need to camelCase postlength and charactersleft like this:

postLength
charactersLeft

instead of the entire variable being lowercase :slightly_smiling: