Stuck on 7. The O shortcut


#1

Does anyone see whats wrong with my code? I get this message each time... "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() {
  $('.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);

#2

@sammyfrank

You forgot to close your function main before calling it. Add a }; between

and


#3

Getting the same message :confused:


#4

@sammyfrank

Between the quotes and article, there should be a dot because you are selecting a class.
What you put in parameter for removeClass method should be "current". It's a class but because we know that we are manipulating with class, we don't need a dot before current. There's no () because we are not calling a function or method, we are putting in parameter a class. So remove that. Same as this line:

Hope this helped you!