Im having an issue with the o shortcut lesson


#1

i get this error message and im not sure what i have incorrect after scanning it several times:
" 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."

here is my 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);

i have a feeling it has to do with the brackets to open and close but not 100 percent on that.

thanks for any help guys :smiley:


#2

document is a variable
so you will have to change your jQuery-Selector
$('document')
into
$(document)