The Site is Telling Me I Need to Remember to Disable the btn After a Post is Entered


#1

var main = function(){
$('.btn').click(function(){
var post = $('.status-box').val();
$('

  • ').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);

    The bold text is where im stumped. the site is telling me i need to remember to disable the btn after a post is entered. This is exactly what i found was the answer. Its still not working!!! im lost as what i need to do.


  • 8/9: need help! sending out an sos! Disabled 2
    #2

    @acres164

    Have a close look at

    $('.btn')addClass('disabled');


    #3

    i forgot the period. $('.btn').addClass('disabled');


    #4

    This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.