So, I have this random number generator that generates a random number after the user clicks the ‘Generate & List Number!’ button, and each time the user clicks it, the numbers change except they don’t unless you refresh the page.
I tried Googling it up, but couldn’t find what I’m looking for.
Math.random() is called in the global space, which is called only when the page is loaded for the first time. If you want it to give a different value each time that the button is pressed, you need to use it in the function that is called when the button is pressed