|
-
Jun 25th, 2000, 04:59 PM
#1
Thread Starter
Hyperactive Member
Hi,
I would like to know how to generate a random number between 1 and 3 using JavaScript. Could you please give me an example? Thanks
-
Jun 26th, 2000, 03:52 AM
#2
Frenzied Member
here you are!
Code:
<SCRIPT LANGUAGE="JavaScript"><!--
function myRnd(){
return(Math.floor(Math.random() * 3)+1)
};
document.write(myRnd());
</script>
-
Jun 27th, 2000, 01:49 AM
#3
Thread Starter
Hyperactive Member
Thanks
Thanks for the help Mark!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|