Error on last step . Need a code check


#1

Hello everyone ,
Not really sure why this is not working . Could someone please check my code .
Thanks in advance
MH

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(charatersLeft < 0) {
        $('.btn').addClass('disabled');
        }    
        else if(charactersLeft == 140) {
            $('.btn').addClass('disabled');
        }
        else  {
            $('.btn').removeCLass('disabled');
        }
    });
    
        $('.btn').addClass('disabled');

    }
    $(document).ready(main);


  • #2

    @hamlet777

    Have a close look at

    addclass


    #3

    @leonhard.wettengmx.n

    Thank you . it now works .


    #4

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