I know this answer here, but I could not find it (or at least recognize it when I saw it!). I am a noob relative for jquery, so bear with me please.
Problem:
I have 20 images named 1.png through 20.png . I would like a different image to be displayed randomly every time the user clicks a button.
What works:
My javascript code for generating a random number is as follows:
var randomImage = 1 + Math.floor(Math.random() * 20);
What not ...
What I'm trying to do is pass the result of my HTML document as the image name so that it reads something like this:
<img id="randImg" class="img_answer" src="randomImage.png">
, , , . , img? - ?