freeCodeCamp/guide/english/certifications/front-end-libraries/bootstrap/create-a-class-to-target-wi.../index.md

1.1 KiB

title
Create a Class to Target with jQuery Selectors

Create a Class to Target with jQuery Selectors

The last challenge had you adding some classes to your html <button></button> elements to style them, this time you are required to add other classes to those buttons which would allow jQuery to target them.

Hint

Edit the classes

Solution

Since you have to add the target class, the following is the solution:

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <div class="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">
      <div class="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>