js数组中随机选取一个数值!!

var arr = ["太阳光大","成功是优点的发挥","不要小看自己", "口说好话","手心向下是助人" ];
alert(arr[Math.floor((Math.random()*arr.length))]);

猜你喜欢

转载自www.cnblogs.com/teamemory/p/10212591.html