I'm trying to have a random image be shown in a div on my page. I want my JS in an external file. Below is what i have but it's not working. Any help would be great
Code:
<script type="text/javascript">
var rand_no = Math.random();
var rand_no = rand_no*5;
rand_no = Math.ceil(rand_no);
var imageCode='<img src="'+ rand_no+ '.gif" alt="" height="10" width="10" border="0">';
document.getElementById("main").innerHTML = imageCode;
</script>