Код для генерации случайного целого от min to max включительно:


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



Copy this code and paste it in your HTML
  1. var rand = min + Math.floor( Math.random() * (max+1-min) );

Report this snippet


Comments


You need to login to view comments.