Tags

, ,

<!DOCTYPE html>
<html>
<head>
<script type=”text/javascript” src=”http://code.jquery.com/jquery-1.9.1.js”></script&gt;
</head>
<body>
<script type=”text/javascript”>
$(document).ready(function(){
$(‘#idRandom’).click(function(){
var images = [],
index = 0;
images[0] = “<a href = ‘http://www.computerhope.com/index.htm’><img src=’http://www.computerhope.com/banners/banner.gif&#8217; alt=’Visit Computer Hope’></a>”;
images[1] = “<a href = ‘http://www.computerhope.com/history/index.htm’><img src=’http://www.computerhope.com/banners/banner2.gif&#8217; alt=’Computer History’></a>”;
images[2] = “<a href = ‘http://www.computerhope.com/index.htm’><img src=’http://www.computerhope.com/banners/banner3.gif&#8217; alt=’Visit Computer Hope’></a>”;
images[3] = “<a href = ‘http://www.computerhope.com/newslet.htm’><img src=’http://www.computerhope.com/banners/banner4.gif&#8217; alt=’Computer Hope Newsletter’></a>”;
index = Math.floor(Math.random() * images.length);
$(‘#idDisplay’).html(images[index]);
});
});

</script>
<input type=”button” name=”” id=”idRandom” value=”Random Images”></input>
<div id=”idDisplay”></div>
</body>
</html>

Advertisements