Target the same element with multiple jQuery Selectors


Whats happening

My code so far

  $(document).ready(function() {


<!-- Only change code above this line. -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
    <div class="col-xs-6">
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>

My browser information

User Agent is: Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36.


First of all, I editted your code to make it more readable. Code should be surround with triple backticks to render it readable. The backtick key is below the ESC key.


As to your question, I’m not sure what the problem is. You haven’t written any JQuery. Acording to the instructions, you need to:

  • Using .addClass(), add only one class at a time to the same element, three different ways:
  • Add the animated class to all elements with type button.
  • Add the shake class to all the buttons with class .btn.
  • Add the btn-primary class to the button with id #target1.

All of that will be inside the $(document).ready(function() function at the top. Please try to do it (using the examples from the problem) and then if you still have problems, let us know and we’ll be happy to help. If you have a specific question, please let us know.