7. The O Shortcut issue with code


7. The O Shortcut

I'm getting this error message and I don't know what to fix...I've read other posts and I can't seem to find my issue...I am 'toggling the article inside the event handler', or at least I think I am. Help please.

"Oops, try again. It looks like the o key isn't opening a description. Remember to toggle the current article's description inside the event handler. Look back at the instructions for the code."

var main = function() {
    $('.article').click( function () {
        $(document).keypress(function(event) {
            if(event.which === 111) {


HI your $(document).keypress(function(event) {..}); shouldn't be inside the $('.article').click( function () {..}); so your code it should look like that

var main = function() { #open the main function
   $('.article').click( function () { #open the click function .article
   } #close the click function .article
   $(document).keypress(function(event) { #open the keypress
   }); #close the keypress
} #close the main function



Ok I managed to get it to work, thank you.

Also, I have a question regarding the 'current' class.
Why in the Add and Remove Class is it just 'current' and not '.current'. That's what I have to type to get it to work on the website. Is that an error or is there a real difference?



It's because when you use the .current with the dot you select the class and when you use the current without the dot it's the name of the class.so the


takes as paramter the name of the class.
you can find find more about it here


i had the same problem but mine still doesn't work


Hi you should create a new topic with your code and the link of the lesson.


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