I don’t think I understand exactly what your not grasping, but make sure you understand addClass.
I’ll post you here jQuery’s official notes, and feel free to ask again if there’s something you don’t get.
addClass: Adds the specified class(es) to each element in the set of matched elements. It’s important to note that this method does not replace a class. It simply adds the class, appending it to any which may already be assigned to the elements.
I do not understand the above question you are asking about the three lines of code you posted.
Are you not understanding the challenge Note (seen below)?
You should only be targeting one element and adding only one class at a time. Altogether, your three individual selectors will end up adding the three classes shake, animated, and btn-primary to #target1.
The first line targets all buttons. Since the button element with id=“target1” is a button, it gets the “animated” classed added to it.
The second line targets all buttons with class .btn Since the button element with id=“target1” has the .btn class, it gets the “shake” classed added to it.
The third line directly targets the button with id=“target1”, so it should be no surprise that the class “btn-primary” added to it.
The third line (seen below) is not selecting a class. It is selecting an id of “target1”. That # in front of “target1” designates that an element with a specific id will be selected. If it would have had a dot (.) in front, then a class would have been selected.
EDIT: Just in case my use of the verb target was confusing, I have changed it to select.
Before you add any jQuery code, the button element with id=“target1” only has the following two classes: btn and btn-default
However, once you implement the three lines of code you wrote, it will have three additional (animated, shake, and btn-primary) for a total of 5 classes. You see the effects of the 3 new ones added, but the html in the editor does not show them.