What am I doing wrong?


#1

Trying to complete the Interactive Website Exercise and am having some issues. Below is a link to the exercise and the error message I am receiving. Also the Live Website will not respond. Thanks in advance for your help. Also, if someone could explain how exactly all the brackets and parenthesis work it would be helpful. I know they break the code up into some sort of blocks or chunks, but I'm having trouble figuring out the "rules" of their usage. The exercises seem to assume you just know how they should work.

https://www.codecademy.com/courses/web-beginner-en-4hxyb/0/7?content_from=make-an-interactive-website%3Ajquery-events#

Uncaught SyntaxError: Invalid or unexpected token

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

@mdklein
You have 1 closing-curly-bracket-} to many
in your article =click= Eventhandler......

==================================================


#3

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