Javascript Random Number Generation (1 - 10)


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var totalItems= 10;
  2. function randomlink(){
  3. return Math.floor(Math.random()*totalItems+1);//return a number between 1 - 10
  4. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.