Colleagues
I would like every time the user accesses the site, a different image appears. I know how to do with PHP, however in this case I would like to do with javascript. I believe the Math.random () , but I do not know much javascript. I tried to do it that way, but it did not work:
<script type="text/javascript">
function aleatorio(){
img[0] = "ciadeli.jpg";
img[1] = "ninashoes.jpg";
img[2] = "odonto.jpg";
var mudar = Math.floor(Math.random()*img.length);
document.getElementById("aleatorio").innerHTML = "<img src='portifolios/"+img[mudar]+"'>";
}
</script>
<div id="aleatorio" onload="aleatorio()"></div>