function changeImage() { document.getElementById("imgRandom").src = document.getElementById("imgRandom").src + "?random=" + Math.floor(Math.random() * 1000 + 1); }
Javascript 随机数
原文:http://www.cnblogs.com/xinboqinheng/p/3948673.html