Need help with exercise 7, "The o shortcut"


#1



https://www.codecademy.com/courses/web-beginner-en-4hxyb/0/7?content_from=make-an-interactive-website%3Ajquery-events#


I have no idea why this issue is happening. It might be because I have a minor syntax error somewhere that I can't see. If someone could look over the code and see what's wrong, I could surely use the fresh pair of eyes. The error is: "Oops, try again. It looks like the o key isn't opening a description. Remember to toggle the current article's description inside the event handler. Look back at the instructions for the code."


var main = function() {
};

$(document).ready(main) {
    $('.article').click() {
        $('.article').removeClass('current');
        $('.description').hide();
        
        $(this).addClass('current');
        $(this).children('.description').show();
    };
    $(document).keypress(function(event) { 
        if(event.which === 111) {
            $('.current').children('.description').toggle();
        }
    });
};


#2

@princebatcat,

The structure of the code should look like

    var main=function() {
         $('.article').click(function() { 
         }); 

         $(document).keypress(function(event) {
         });
       };
      $(document).ready(main);

#3

Still getting the error. =/


#4

@princebatcat
Present the FULL code you are using at present....


#5

Perhaps this is the problem? You should have the closing tag at the end of the code.


#6

The thing is, the past few exercises have passed without any problem, which is why I'm unsure as to why it's failing now since all I did between last exercise and this one was add what the instructions said. Heck, I even copied and pasted it without success. I'll just toying around with the syntax and see what happens.