Give Each Element a Unique ID

Tell us what’s happening:

Your code so far

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/give-each-element-a-unique-id

i don’t know how to Target the element with the id target3 and use the jQuery addClass() function to give it the class fadeOut.

I think you linked to the wrong challenge. Maybe you meant Target Elements by ID Using jQuery.

Anyway, at the top of the code there should be two examples on how to target specific elements and usage of the addClass function. There’s also an example of targetting elements by id in the instructions.

1 Like