I’m working on the Random Quote Generator and the button is not triggering a new quote.
I’m keeping it simple on this one and using an array that I’ve built.
I’ve looked around but can’t get it to work - I’m missing something. I’m not grasping the concept.
<button id = "getQuote" class = "button" onclick="getElementById("quote").innerHTML = getRandomQuote()">
On the onclick, you have double quotes inside double quotes which is closing the attribute prematurely and thus causing errors. Replace "quote" with 'quote' for the onclick to fire properly.
Furthermore the onclick should probably just be onclick=getRandomQuote(), if you’re looking to fire that on click.