1. 程式人生 > >JS動態事件隨機字符圖片

JS動態事件隨機字符圖片

type class dex min 動態 img math name -name

    • <script type="text/javascript" src="js/jquery.min.js"></script>
    • <script type="text/javascript">
    • arr_wx = ["1","2","3","4","5","6"];
    • var wx_index = Math.floor((Math.random() * arr_wx.length)); //,‘‘
    • var stxlwx = arr_wx[wx_index];
    • var img = arr_wx[wx_index];
    • </script>
    • body
    • <script>
    • document.write("<img src=\"picture/" + img + ".jpg\">");
    • </script>
    • <script>document.write(stxlwx);</script>

JS動態事件隨機字符圖片