I've Passed the Lesson, The Code Doesn't Work


#1



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

I'm trying to figure out what's wrong with this code, It says i've passed but when i pressed the o/n shortcut doesn't work. Please help


var main = function() {
  $('.article').click(function() {
    $('.article').removeClass('current');
    $('.description').hide();

    $(this).addClass('current');
    $(this).children('.description').show();
  }
});

$(document).keypress(function(event) {
});
 
$(document).ready(main);


#2

Hi you didn't close the main function

var main = function() {

}

then here

  $('.article').click(function() {
    $('.article').removeClass('current');
    $('.description').hide();

    $(this).addClass('current');
    $(this).children('.description').show();
  } <-- #Remove the }
});

#4

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