The o short cut - code passed but doesn't actually work


#1

I've somehow managed to 'pass' this lesson, yet the o key doesn't actually toggle.

Any advice? Here's my code:

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

@carlfrie2 you are closing out your function before the .keypress() line. Take out the }); that's two lines above this line:

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

It is closing out your function before including the .keypress().


#3

@carlfrie2 In line 5, remove the point in ".current"