Thread
:
I want to generate random number in JAVASCRIPT?
View Single Post
08-25-2008, 05:28 PM
#
8
wezy
Status:
Junior Member
Join date:
Jul 2008
Location:
Belgium
Expertise:
Software:
Posts:
26
iTrader:
0
/ 0%
U could use
Code:
var randomnumber = 2 * Math.floor(Math.random() * 50) + 1
You will get a number between 1 and 99 in this case.
If you want even numbers drop the + 1
Hope this helps.
Wezy
wezy
View Public Profile
Visit wezy's homepage!
Find More Posts by wezy