W3School TIY
编辑您的代码:
<html> <body> <script type="text/javascript"> var r=Math.random() if (r>0.5) { document.write("<a href='../index.htm'/*tpa=http://www.jb51.net/*/>学习 Web 开发!</a>") } else { document.write("<a href='http://www.microsoft.com/'>访问微软!</a>") } </script> </body> </html>
查看结果: