Freecodecamp: nth-child challenge cant accept correct answer

Created on 5 Mar 2016  路  4Comments  路  Source: freeCodeCamp/freeCodeCamp

Challenge Target a Specific Child of an Element Using jQuery has an issue.
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.11 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

<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("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>

My code is above, I think my answer is correct,but can't pass the test! Where i did wrong?

Most helpful comment

try this:
$(".target:nth-child(2)").addClass("animated bounce");

All 4 comments

There's still one more class that you need to add before your element will bounce. Please ask in the Help Chat first to check for mistakes.

try this:
$(".target:nth-child(2)").addClass("animated bounce");

I noticed the next lesson specifically states to add the animate class, along with the shake class.
Shouldn't this lesson also state to add the animate class along with the bounce class?

Thanks

$(".target:nth-child(2)").addClass("animated bounce"); is the correct answer, however the compiler would not take my answer initially, that is, I had to press submit three times ( I was frustrated) until it finally took the answer.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ar5had picture ar5had  路  3Comments

jurijuri picture jurijuri  路  3Comments

MelissaManning picture MelissaManning  路  3Comments

DaphnisM picture DaphnisM  路  3Comments

robwelan picture robwelan  路  3Comments