Ticker

6/recent/ticker-posts

Random image generator using html and javascript

 <html>

<head>

var pic=new Array("b.jpg","c.jpg","d.jpg");

function aa()

{

var rn=Math.floor(Math.random()*pic.length);

document.getElementById("mpic").src=pic[rn];

}

</head>

<body>

<img src="a.jpg" width=300 height=300 id="mpic">

<input type="button" value="random image" onclick="aa()">

</body>

</html>

Post a Comment

0 Comments