Error in Code for 5. Mark the Current Article


#1



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


I keep getting the error message 'Oops, try again. Add the line $('.article').removeClass('current'); inside your $('.article').click() function.' but I can't see what's wrong with my code, it looks the same as the hint as far as I can tell, please help!

var main = function() {
    $('.article').click(function() {
        $('.article').removeCLass('current');
        $('.description').hide();
        $(this).addClass('current');
        $(this).children('.description').show();
       
    });
};

$(document).ready(main);


#2

HI this line

$('.article').removeCLass('current');

you wrote .removeCLass instead of .removeClass


#3

You have spelt removeClass wrong in line 3 of your code, @huneeya


#4

Thank you so much @bartholomewallen and @wizmarco !!


#5

No worries @huneeya. I'm glad to know that your issue was resolved. Keep coding hard :laughing:!


#6

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