刷新后更新图片

window.onload = choosePic;
        function choosePic() {
            var myPix = new Array('./tupian/二维码02.png', './tupian/二维码.jpg', './tupian/qrcode.bmp');
            var randomNum = Math.floor((Math.random() * myPix.length));
    //下面的id与img标签上对应,可以设置多个
            document.getElementById('bianhua').src = myPix[randomNum];
            document.getElementById('bianhua1').src = myPix[randomNum];
        }
posted @ 2020-04-24 15:44  鱼毛毛  阅读(140)  评论(0编辑  收藏  举报