I keep getting that "o" does not open the article


#1

var main = function() {
$('.article').click(function() {
$(document).keypress(function(event) {
if(event.which === 111) {
$('.current').children('.description').toggle();
}
});
$(this).addClass('current');
$('.description').hide();
$('.article').removeClass('current');
$('.description').hide(function() {
});
$(this).children('.description').show();
});

}
$(document).ready(main);

I keep getting that "o" does not open the article. I checked it several times and even copied the code from the hint, and it is still not working. Thank you in advance.


Stuck on 7/10
#2

Hi your function inside the main function should be like that

var main = function() {
   $('.article').click(function() { 
      ...
   }

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

$(document).ready(main);

#5

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