@devtechk I ran into this issue as well. I could not get one of the test cases “Your #target1 element should have the classes animated‚ shake and btn-primary” to complete. After asking for assistance in /HELP it was suggested to run the code in a different browser. I was able to complete all of the test cases using FireFox instead of Chrome.
I find difficulty in understanding the concept… though the given code was the one I used and completed the challenge, but i cant get the concept right… it says
Note
You should only be targeting one element and adding only one class at a time. Altogether, your three individual selectors will end up adding the three classes shake, animated, and btn-primary to #target1.
But its actually being applied to all buttons,not just to the button with id #target1, or is it supposed to work that way… or am I not understanding it correctly… Im still not completely clear about this challenge…
If it is to make us understand the inheritance pattern then that’s not working here… and it could be a bug
Im on Firefox by the way and always prefer it over chrome…
Hi All,
for those who think they have the same code but it’s not working, please check if you wrote : “addClass” or “addclass”.
JavaScript is case sensitive.
The main objective of this code is to shake all buttons and target1 button should have extra functionality than others by putting more class in target1 using jquery directly
$("button").addClass("animated");
This code target all buttons with “button selector” and give them “animated” class
from now all button have class called “animated”
$(".btn").addClass("shake");
This code will put “shake” class in class that alredy have “btn” class
and shake all buttons
$("#target1").addClass("btn-primary");
This code will putt “btn-primary” class in element that have “#target1” id
so your target1 button looks blue
I had the same problem.
I typed the exact same code, It wasn’t working so I simply copied and paste from camperbot and voila!!! Worked. Still don’t know why. maybe if i had copied my code and pasted it back, it might have worked…, __
the code that should we write in this challenge is :
$(“button”).addClass(“animated”);
$(“.btn”).addClass(“shake”);
$(“#target1”).addClass(“btn-primary”);
first put the code then wait util the iphone screen reload finally press RUN TEST(ctrl+enter)
…$(document).ready(function() {
$(“button”).addClass(“animated bounce”);
$(".well").addClass(“animated shake”);
$("#target3").addClass(“animated fadeOut”);
$(“button”).removeClass(“btn-default”);…
This is what the code should look like. People seem to be misunderstanding the #target1 is the example and for this lesson button should be in place as in my code above.