7. o shortcut


#1

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').childern('.description').toggle();
        }
    });
}

$(document).ready(main);

it goes to the next lesson but when i press 'o' it doesn't work. what did i do wrong?

thanks have a great day :DDD


#2

Hi Tommy,

↑ Your problem is right there :slightly_smiling: