Completed news reader but key o and n still dont work


#1



Hi I have finished the News reader section and it completes but my n key and o key does not work can anyone take a look at my code please?

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);


Replace this line with your code.


#2

Hello @jayunit2309,

Try clicking on a subheading to select it and use you n and o keys. Your code is correct so I'm assuming it has something to with that.


#3

HI this line

$(this).addClass('.current');

remove the dot to 'current'