Not sure what the issue could be - animated - opacity

Tell us what’s happening:
every time you click the new qutoe btn the data being passed through takes longer to load with every press.

Your code so far
https://codepen.io/gsparmar/pen/mdrvWRB

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36.

Challenge: Build a Random Quote Machine

Link to the challenge:

Take a look at the jquery click method, it might not be behaving the way you expect.

1 Like

I switched it to inline onClick=“getQuote()” - and it fixed the issue.

isn’t the jquery click method a shorten version for on.(“click”, handler)??

also TY!

It is and similarly to on it doesn’t just set event handler for the element, but with each call it adds a new one. As click was called in the function called after pressing button, with each press of the button additional event handler was added to the element.

1 Like