Build a Random Quote Machine [on load attribute$$$$]

Build a Random Quote Machine [on load attribute$$$$]
0

#1

Tell us what’s happening:
please i need help implementing the on load event attribute

Your code so far


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3223.0 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/front-end-libraries-projects/build-a-random-quote-machine/


#2

What have you tried so far?

First of all, with dealing with jQuery and DOM elements it’s always good to wrap your code in a document/ready.

Once you do that, you just need to call the code that gets a new quote. How about taking that anonymous function that you’re giving to the click handler and put it in “real” function. Then you could also call it when the page first loads, giving you the first quote.


#3

that was really helpful, thanks a bunch