Monday, 16 July 2012
How to use javascript random link
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script type="text/javascript">
var r=Math.random();
var x=document.getElementById("demo")
if (r>0.5)
{
x.innerHTML="<a href='http://w3schools.com'>Visit W3Schools</a>";
}
else
{
x.innerHTML="<a href='http://wtf.org'>Visit WTF</a>";
}
</script>
</body>
</html>
This post was written by: Bharathi
Bharthi is a professional blogger, web designer and front end web developer. Follow him on Twitter
Subscribe to:
Post Comments (Atom)
0 Responses to “How to use javascript random link”
Post a Comment