I'm trying to create a script to call 5 random images for a "captcha type thing"
this is the code I have
# function showImg() {
var imgNumber = randomInteger(9);
document.write('<img src=" + imgNumber + " alt="" />');
}
#
That is in the <head>
#
function randomInteger(size) {
return Math.floor((size+1)*Math.random());
}
#
That is in an external file
#
<td colspan="2" class="center">
<script type="text/javascript">
showImg();
showImg();
showImg();
showImg();
showImg();
</script>
</td>
#
And then that is where I want to call that function 5 time to produce 5 random images
What am I missing?