Keyboard Shortcuts


#1

It says I passed this lesson, but the code doesn't work! What's wrong?

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

$(document).ready(main);

#2

Hi Sarah,

Your $(document).keypress(...) chunk can't be nested inside the $('.article').click(...) piece of code.
Also, what is this randomly doing at the end of a line?

And, you need to close your $('.article').click(...) part, since you're only closing the $(document).keypress(...) section and your main function.