I don't understand something


I don't understand why we first access the selector '.active-dot' and then use .removeClass to remove 'active-dot' class. Similarily, why do we access '.active-slide' and then remove 'active-slide' class? Aren't we supposed to access classes by . and Ids by # in jQuery?


The removeClass methods know that you'll be working with classes/ids, so you don't need the . or #.


The programs don't work if I don't put .
They sometimes don't work when I put it.
I am confused by the instructions. Sometimes they say to use ., sometimes they don't.

(From Get a Hint)
$('.arrow-prev').click(function() {
var currentSlide = $('.active-slide');
var prevSlide = currentSlide.prev();

var currentDot = $('.active-dot');
var prevDot = currentDot.prev();

if(prevSlide.length === 0) {
prevSlide = $('.slide').last();




You don't need them in removeClass or addClass as I said,

You need them otherwise.