7.the o short cut


#1

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);

this is my code. can you tell me what's wrong?


#2

Hi Ooooooongi,

You need to close the $('.article').click(...); bit before the $(document).keypress(...); bit. So try moving line 14 up to line 8 :slightly_smiling: