I have a div in my HTML that that when rolled over reveals an image.
I can't figure out how to place a random image from a set of 5 images to appear in the background of that div when it is rolled over again. Please help me!
There is more than one way of writing this. Hope it helps
HTML
<div id='picture' onmouseover="mouseover()"></div>
JS
function mouseover(){
var rand_Img = Math.floor(Math.random()*5+1);
var img_roll_over = document.getElementById('picture').style.backgroundImage="url(Image_"+rand_Img+".jpg)";