I've been working on creating a random quote generator that generates a new quote whenever a button is clicked. However, I seem to have everything set up correctly but for some reason, when the button is clicked nothing happens.
Below is the code I have implemented:
HTML code
<div class="quote-box">
<p id = "quote-generator"> This is where the generated quote will be displayed </p>
<button class="btn" onclick="function newQuote()"> Next </button>
</div>
JS code
var list = [
'/"Your mind will always believe what you tell it. Feed it faith. Feed it the truth. Feed it with love. /"',
'/"A problem is a chance for you to do your best./"',
'/"Learn how to be happy with what you have while you pursue all that you want./"',];`
const randomNumber = Math.floor(Math.random()*list.lenght);
function newQuote() {
document.getElementById("quotes-generator").innerHTML = list [randomNumber];`
}