The n shortcut 2


#1

What is wrong with my code. It doesn't work
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();
                }
            else if(event.which === 110){
                    var currentArticle = $('.current');
                    var nextArticle = currentArticle.next();
                    currentArticle.removeClass('.current');
                    nextArticle.addClass('.current');
                }    
        });    
};

$(document).ready(main);


#2

Hi Muntean21,

Take a look here:

and see if you can find the problem :slightly_smiling:

Hint

You need to remove the dot (.) inside your addClass() and removeClass() function calls.


#3

Thank you very much for your help!


#4

I have a problem on the same question and I already removed the dots (.) inside the classes and it still tells me it's wrong.. Help please.


#5

@rico321 Create a new topic with your code, a link to the exercise you're on, and the error message you're getting, and someone will help you over there :slightly_smiling:


#6