RUNOOB.COM
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>电脑学习网教程(runoob.com)</title> </head> <body> <p id="demo"></p> <script> var r=Math.random(); var x=document.getElementById("demo") if (r>0.5){ x.innerHTML="<a href='http://www.runoob.com'>访问电脑学习网教程</a>"; } else{ x.innerHTML="<a href='http://wwf.org'>Visit WWF</a>"; } </script> </body> </html>
运行结果