Trouble with the .click and .keypress


#1



Hi! I'm stuck on 7. The o shortcut. The shortcut isn't working AND the .click isn't working, but codeacademy told me my code was correct!

I'm receiving two error messages:
"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."

"Uncaught SyntaxError: missing ) after argument list"


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

$(document).ready(main);


#2

@ambarendse

Have a close look at

fuction()


#3

<
Got it.

Thanks...


#4

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