css - jQuery class selector "class_name" vs ".class_name" -
when looking through jquery examples, see css classes referred prepending "." , other times without. example, in snippet codecademy:
else if(event.which === 110) { var currentarticle = $('.current'); var nextarticle = currentarticle.next(); currentarticle.removeclass('current');
why selector $('.current') needed in 2nd line, ('current') required in 4th line?
that convention.
on 2nd line $('.current') telling jquery search called "current" , dot specifies class. need call ".current"
on 4th line, you're telling jquery going select class using "removeclass" don't need use dot there. because "removeclass current being class"