"Mark the current article" are not changing color


#1

Hello! There is my code in lesson 5:

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

$(document).ready(main);

The issue: when I click to article it don't change its color. Code is submitted without errors.


#2

Hi Creepmah,

add/remove/toggleClass() take only a class name as an input. The dot (.) is used to separate a class name from an id or tag, but add/remove/toggleClass() know they're getting a class as an input, so no need to differentiate between the selectors :)


#3

Oh, really, big thanks!:grinning: