Posts don't contain any text when added


#1

Hello everyone, I've completed the whole activity but the messages I post show empty once I click the post button, I don't know why, 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'); 

$('.btn').addClass('disabled');
  
  });
  
  
  
  
 $('.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);

Thanks in advance for your help!


This won't work... Create a new post
#2

Hi Carlos,

Line 6 - 'status-box' should be '.status-box' :)