To create a random number in javascript you can use the following snippet.
Sample JS
var random=Math.floor((Math.random() * 10) + 1);
Result
A random number between 1 and 10.
fore more informations see W3Schools JavaScript random() Method
All the Code Snippets and Samples you need
To create a random number in javascript you can use the following snippet.
var random=Math.floor((Math.random() * 10) + 1);
Result
A random number between 1 and 10.
fore more informations see W3Schools JavaScript random() Method
You must be logged in to post a comment.
RT @CodeSnippetsNET: How to create a random number in javascript http://t.co/it7Wrles6k #js #javascript #html
RT @CodeSnippetsNET: How to create a random number in javascript http://t.co/it7Wrles6k #js #javascript #html