# Multiple jQuery Selectors

**URL:** <https://forum.freecodecamp.org/t/multiple-jquery-selectors/85550>\
**Category:** General\
**Created:** [February 9, 2017, 4:30pm UTC](https://forum.freecodecamp.org/t/multiple-jquery-selectors/85550 "2017-02-09T16:30:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BachAmadou](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bachamadou/32/240519_2.png) [@BachAmadou](https://forum.freecodecamp.org/u/BachAmadou)\
**Post date:** [February 9, 2017, 4:30pm UTC](https://forum.freecodecamp.org/t/multiple-jquery-selectors/85550/1 "2017-02-09T16:30:39Z")

</div>

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.

THIS IS THE CODE:

### jQuery Playground

#### #left-well

 #target1 #target2 #target3 

#### #right-well

 #target4 #target5 #target6

---

<div class="post-metadata">

**Author:** ![rmonastra](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/rmonastra/32/67696_2.png) [@rmonastra](https://forum.freecodecamp.org/u/rmonastra)\
**Post date:** [February 11, 2017, 10:24pm UTC](https://forum.freecodecamp.org/t/multiple-jquery-selectors/85550/2 "2017-02-11T22:24:48Z")

</div>

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 [http://www.w3schools.com/jquery/html\_addclass.asp](http://www.w3schools.com/jquery/html_addclass.asp).

---

<div class="post-metadata">

**Author:** ![BachAmadou](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bachamadou/32/240519_2.png) [@BachAmadou](https://forum.freecodecamp.org/u/BachAmadou)\
**Post date:** [February 11, 2017, 11:03pm UTC](https://forum.freecodecamp.org/t/multiple-jquery-selectors/85550/3 "2017-02-11T23:03:58Z")

</div>

@rmonastra

ok l will check your suggestions. Thank you a lot

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 5:24pm UTC](https://forum.freecodecamp.org/t/multiple-jquery-selectors/85550/4 "2021-01-16T17:24:31Z")

</div>

Closed on January 16, 2021, 5:24pm UTC


