7/9 Disable the Button 1- unexpected token )


#1

Can anyone please help with this one. I am getting an error " Unexpected token ) on line 31 (at the end of the keyup function).

 var main = function() {
        //Add a .click() method with a function inside.
        $('.btn').click(function(){
        // Store what is typed in the status-box in the variable post
            var post =$('.status-box').val();
            // Use .prependTo('.posts') to prepend it to the <ul class="posts">..</ul>
            $('<li>').text(post).prependTo('.posts');
            //  select the 'status-box' class and set its value to empty
            $('.status-box').val('');
            // select the CSS class 'counter' and Replace its text with "140"
            $('.counter').text('140');
        });// end click fuction, start keyup function
        $('.status-box').keyup(function(){
            // In variable postLength store the length of the message typed in the status box
            var postLength =$(this).val().length;
            // create & set variable equal to 140 minus postLength
            var charactersLeft =140-postLength;
            // Select the 'counter' class & update its text with charactersLeft
            $('.counter').text(charactersLeft);
         // Check and Disable Message Entry if too long
        if (charactersLeft <0) {
            $('.btn').addClass('disabled');
        } // end if
        else if (charactersLeft ==140) {
            $('.btn').addClass('disabled');
        } //end else if
        else {
            $('.btn').removeClass('disabled');
        } //end else
        )} //end keyup function - unexpected token )
    } //end main
    $(document).ready(main);

#2

Fixed it.
Reversed closing bracket and brace * })* at the end of the keyup function. Also added code $('.btn').addClass('disabled'); after end of keyup function and end of main