7. the O shortcut


#1



https://www.codecademy.com/en/courses/web-beginner-en-4hxyb/0/7?content_from=make-an-interactive-website%3Ajquery-events


My code passes, but the O shortcut doesn't work when I actually try it.


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

Hi Cap,

Your code looks fine to me - do you get any messages, or does it just not work?

Make sure you're clicking on an article before you press the O key.


#3

Just doesn't work. And I am clicking on an article first.


#4

@cap_tan Odd :confused: Could you post a link to the exercise you're on, then?


#5

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