[代码] 点击超链接随机打开网址

[复制链接]
本站网友  发表于 2024-1-23 11:13 |阅读模式

随机超链接

  1. <html>
  2. <head>
  3.     <script type="text/javascript">

  4.         function openLink(e) {
  5.             var url = new Array();
  6.             url[0] = "http://www.baidu.com";
  7.             url[1] = "http://www.csdn.net";
  8.             url[2] = "http://bbs.voc.com.cn";
  9.             var ints = parseInt(Math.random() * (url.length));
  10.             e.href = url[ints];
  11.             return false;
  12.         }
  13.     </script>
  14. </head>
  15. <body>
  16. </body>
  17. <a href="#" onclick="openLink(this)" target="_blank" rel="nofollow noopener noreferrer">Try to Click</a>
  18. </html>
复制代码

QQ|删帖注销|手机版|资源圈

GMT+8, 2024-5-3 15:40

Powered by Discuz!

© 20022-2026 Comsenz Inc.

快速回复 返回顶部 返回列表