Forum Moderators: open
<html>
<head>
<title></title>
<style type="text/css">
#bgChange {
background-image:url(/images/staff/index_staff_001.jpg);
}
</style>
<script type="text/javascript">
function random_image()
{
image_array = new Array();
image_array[0] = '/images/staff/index_staff_002.jpg';
image_array[1] = '/images/staff/index_staff_003.jpg';
image_array[2] = '/images/staff/index_staff_004.jpg';
count = image_array.length;
random = Math.floor(Math.random() * count);
document.getElementById('bgChange').style.backgroundImage = "url(" + image_array[random] + ")";
}
</script>
</head>
<body onload="random_image();">
<table id="bgChange" width="400" height="400">
<tr>
<td> </td>
</tr></table>
</body>
</html>
I need help! This doesn't work when I put the scripts in the actual HTML file that I need it to work in.