function sj() { //x上限,y下限 var x = 2000; var y = 1800; var rand = parseInt(Math.random() * (x - y + 1) + y); console.log(rand); } $('#date').click(function() { sj(); });
js生成一个上限跟下限的随机数
猜你喜欢
转载自www.cnblogs.com/lcxin/p/11743282.html
今日推荐
周排行