Multiple jQuery Selectors

hi guys lm stuck so l need help with my jQuery challenge , l was not able to answer the question 4:

  1. Use the $(“button”) selector.
  2. Use the $(".btn") selector.
  3. Use the $("#target1") selector.
  4. Only add one class with each of your three selectors.
  5. Your #target1 element should have the classes animated‚ shake and btn-primary.
  6. Only use jQuery to add these classes to the element.


jQuery Playground


#target1 #target2 #target3


#target4 #target5 #target6

In your HTML, did you assign a class to the elements? “#” is used for IDs and “.” is used for classes, like $(".btn") selector. Then is your CSS: .btn{}(defines the attributes for the class) #target1{}(defines the attributes for the ID)
It would look similar to:

You can use “addClass()” is add a class through JQuery. A decent little guide is at


ok l will check your suggestions. Thank you a lot