7/10 The O shortcut, can't pass exercise


#1

Same problem as above

var main = function(){
    $('.article').click(function() {
        $('.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);

7/10 The O Shortcut
#2

Hi Rangersgg1,

I believe you need to add a closing curly brace (}) to close your main() function right before the last line so it looks like this:

var main = function() {
  // ...
} // ← you're missing this

$(document).ready(main);

#3

Thank you very much!


#4

A post was split to a new topic: Need help on 7/10 The O Shortcut