Freecodecamp: The challenge "waypont: Target the same element with multiple jQuery Selectors" seems to have multiple conflicts

Created on 5 Jan 2016  Â·  14Comments  Â·  Source: freeCodeCamp/freeCodeCamp

Whenever the waypoint asks to "Only add one class with each of the three selectors." I am also told that my "#target1 element should have the classes animated‚ shake and btn-primary."

What I am trying to say is why is the waypoint telling me to only add one class with each of the three selectors, when the waypioint is also telling me to add more than one class to #target1?

screenshot-www freecodecamp com 2016-01-05 06-13-50

Most helpful comment

The correct solution would be:

$(document).ready(function() {
    $("button").addClass("animated");
    $(".btn").addClass("shake");
    $("#target1").addClass("btn-primary");
  });

Apart from that to clear the confusion that you have:

  1. Only add one class with each of your three selectors. - Refer the code that I have posted.
  2. Your #target1 element should have the classes animated‚ shake and btn-primary. - This test case means that when jQuery code (the code above) is executed, then the net effect would be that the <button> element will have these three classes, as a result of your JavaScript (jQuery code).

Hope this helps! Goodluck.

All 14 comments

I am also not able to finish the challenge because it will not accept one class or three classes with the #target1 selector.

Or maybe I screwed up some how and I don't know it...yet.

The correct solution would be:

$(document).ready(function() {
    $("button").addClass("animated");
    $(".btn").addClass("shake");
    $("#target1").addClass("btn-primary");
  });

Apart from that to clear the confusion that you have:

  1. Only add one class with each of your three selectors. - Refer the code that I have posted.
  2. Your #target1 element should have the classes animated‚ shake and btn-primary. - This test case means that when jQuery code (the code above) is executed, then the net effect would be that the <button> element will have these three classes, as a result of your JavaScript (jQuery code).

Hope this helps! Goodluck.

When it comes to the addClass I always forget to capitalize the word Class that is why it won't accept my answers.

And thank you for clarifying that for me

Sure thing. Happy to help! :smile:

Everything clear now, thanks

7378
Thanks

try to make one " " not for each element

$("button").addClass("animated shake");
$(".btn").addClass("animated shake");
$("#target1").addClass("animated shake");
$("#target1").addClass("animated shake btn-primary");

Only add one class with each of your three selectors.

This is the passing I don't know where I am wrong please help

@Saraswati-rajkumar
Please use the Help chat room for getting challenge related help.

Happy Coding.

removed solution by mod

Just that. Good Luck

@raisedadead tnx broii :)

nobody told me capitalise C in Class thank u

removed solution by mod

Note to me:

• don't use a <.> when you need a <-> AND
• don't add syntax that is not asked for in the challenge.

Was this page helpful?
0 / 5 - 0 ratings