Interactive Website: Status Website; 7.Disable the Button 1


#1

help! I have gone through every post, including the archived posts, in regards to this same issue.
code:
var main = function() {
$('.btn').click(function() {
var post = $('.status-box').val();
$('

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

    ERROR is as Follows:
    "Oops, try again. Remember to add the line $('.btn').addClass('disabled'); outside your keyup event handler"

    I've moved brackets, parenthesises, and all the colons in the world. I've taken every suggested edit and tried to repair the crude out of it for nothing. Now I have gone back in and essentially copy/pasted from the "hint"... buut... nothing. Same error. Any suggestions? is the suggested code in the hints just garbage? Any and all help will be greatly appreciated.


  • #2

    Hi Havahaja,

    Do you get passed if you refresh the page or switch browsers?


    #3

    Actually, I'm lucky enough to have a coder boyfriend. Apparently I was missing a symbol. Face, meet palm. Thank you for your response!