Target a Specific Child of an Element Using jQuery on my PC

Target a Specific Child of an Element Using jQuery on my PC
0

#1

**When I run this code in freecodecamp it runs with some animation. When I copy it to my editor and run it it doesn’t run the same way
I know that we need bootstrap and jquery to be included in my file like this
in the head tag

<link rel="stylesheet" href="css/bootstrap.min.css">

and before the end

<script src="js/jquery.slim.min.js"></script>
<script src="js/bootstrap.min.js"></script>

this is the code which I copy from freecodecamp address
Target a Specific Child of an Element Using jQuery
**

<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");
    $("#target1").prop("disabled", true);
    $("#target4").remove();
    $("#target2").appendTo("#right-well");
    $("#target5").clone().appendTo("#left-well");
    $("#target1").parent().css("background-color", "red");
    $("#right-well").children().css("color", "orange");
    $(".target:nth-child(2)").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">
        <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>

#2

You don’t seem to have animate.css.

https://daneden.github.io/animate.css/


#3

Thank you very much. It works now.