<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>
0 Comments