Onclick event only works once?
I'm working on a page that uses a clickable div that works as a button. I used the onclick event to make a function that would choose 1 from a variety of random quotes and show it on screen. Unfortunately when the user clicks on the event a quotes does show up, but it only works once. If the user tries to click the div again it doesn't work. What can I do so the clickable event can be triggered more than once and keep choosing one of the variety of quotes that it has with each click. This is the fraction of code I'm having trouble with: <div id = "llamaText" onClick = 'selectQuote'> Click here </div> <script> let quote = ["Always move forward", "Keep fighting", "Never give up"] let randomNum = quote[Math.floor(Math.random()*quote.length)]; function selectQuote() { document.getElementById("llamaText").innerHTML = randomNum; } </script> Thank you to anyone that takes the time to help!