Submissions of #7 and #9 checkpoints throwing incorrect errors


#1


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

In both these exercises I had the code exactly as it should be. For #7:

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

... and for #9

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

With both submissions I got an error, but if I went to the lessons menu, skipped ahead, added the next lines of necessary code (without changing anything that was throwing an error), the submission would be approved.

Just an FYI to keep people from banging their heads against the wall....


#2

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