jQuery - Target Elements by Class Using jQuery

I dont understand the question.
Do Want everyone explain for me?

Elementos de destino por classe usando jQuery

Você vê como fizemos todos os seus button elementos saltarem? Nós os selecionamos com $("button") , então adicionamos algumas classes CSS a eles com .addClass("animated bounce"); .

Você acabou de usar .addClass() a função do jQuery, que permite adicionar classes aos elementos.

Primeiro, vamos direcionar seus div elementos com a classe well usando o $(".well") seletor.

Observe que, assim como nas declarações CSS, você digita a . antes do nome da classe.

Em seguida, use a função do jQuery .addClass() para adicionar as classes animated e os arquivos shake .

Por exemplo, você pode fazer todos os elementos com a classe text-primary tremerem adicionando o seguinte ao seu document ready function :slight_smile:

  • Você deve usar a função jQuery addClass() para dar as classes animated e shake para todos os seus elementos com a classe well .

  • Esperando :Você só deve usar jQuery para adicionar essas classes ao elemento.

<script>
  $(document).ready(function() {
    $("button").addClass("animated bounce");
  });
</script>

<!-- 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">
      <h4>#left-well</h4>
      <div class="well" id="left-well" $addClass("animated shake">
        <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>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <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>
      </div>
    </div>
  </div>
</div>

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36

Challenge: jQuery - Target Elements by Class Using jQuery

Link to the challenge:

hello and welcome to fcc forum :slight_smile:

do you understand example given in “instructions”? if so then lets read from instructions

First, let’s target your div elements with the class well by using the $(".well") selector.
Note that, just like with CSS declarations, you type a . before the class’s name.
Then use jQuery’s .addClass() function to add the classes animated and shake

combine all these together to carryout this step, for hint look at given example, happy learning :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.