I am having trouble with Javascript part. I don’t understand Javascript too well, so I am wondering if anyone can give me any tips on how to clean this up or to get it mildly working and pulling in quotes.
3 errors that you can correct to atleast display some quotes
- you refer to the wrong element for your event generation event listener
$("#newQuote").on("click", function() {
getQuote();
});
the element id you want to attach it to is actually called #new-quote
-
Your function refrence is also wrong , the function you want to refer to is
getQuotes()
-
In jQuery, when you wan to select a class element you precede it with a period but an id element should be preceded with a hashtag(#), see this line below
$(".text").text(randomQuote)
Do these above to at least generate and display your quotes, but there is still a lot more room for improvement
Thanks a lot for the quick feedback! That helps a lot.
I have passed every step except “the #quote-box wrapper element should be horizontally centered.” I cannot seem to get this one? Any help would be appreciated!
All the tests pass for me, sometimes it will get stuck on test#8 or #9, but that is because you only have 4 quotes to choose from and you can’t have the same quote consecutively generated, remedy for that is to add more quotes to your array.