<p id="demo"></p> <script> var r=Math.random(); var x=document.getElementById("demo") if (r>0.5) { x.innerHTML="<a href='http://'>Visit Vue5教程</a>"; } else { x.innerHTML="<a href='http://wwf.org'>Visit WWF</a>"; } </script>