What is wrong with my code


#1



var main =function()
{
    $('.article').click(function()
{
    
  $(document).keypress(function(event) {
  
        if(event.which === 111) {
        
    $('.current').children('.description').toggle();
    
        }
       else if(event.which === 110) {
  var currentArticle = $('.current');
  var nextArticle = currentArticle.next();

  currentArticle.removeClass('current');
  nextArticle.addClass('current');
}
  });
    $('.article').removeClass('current');
    $('.description').hide();
    
$(this).addClass('current');

    $(this).children('.description').show();
});
$(document).ready(main);

};


#2

Hi your code should have that structure

var main = function() {#open the main function
    $('.article').click(function() { #open the click function .article
        ....
    }); #close the click function .article

    $(document).keypress(function(event) { #open the keypress 
        ...
    });#close the keypress
    
}#close the main function

#3

Please post a link to this exercise. Thank you.