Posted By

alvincrespo on 03/03/10


Tagged

javascript numbers random


Versions (?)

Javascript Random Number Generation (1 - 10)


 / Published in: JavaScript
 

  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  

You need to login to post a comment.