Random Number Generator for HTML?
I am looking for a HTML code that can generate a single random number between (and including) 1 and 38 and assign it to a variable. (I'm calling that variable "ran")
I would really appreciate any help.
I was talking about generating random numbers within a SCRIPT tag. I'm trying to make the webpage play a random song and I have everything working properly except the random number generator. The code I'm using does seem to have access to all the possible choices.
When I inserted J P's code,
var randNum = Math.ceil(Math.random()*10);
it seems to work. I have one question. Does the number range include the endpoints?