Tell us what’s happening:
//html code//
<div class="products">
<div class="product">
<img id="myimg" src="images/cover.jpg" alt="product"><!--image save as from googel-->
<div>More info</div>
</div>
//js code//
myElement=document.getElementById('myimg');
myimgs['images/cover.jpg','images/download.jpg']
function changeImg(myElement,myimgs){
var myRondomNum=Math.floor(Math.random()* myimgs.length);
setInterval(function(){
myElement.src=myimgs[myRondomNum];
},1000);
}
changeImg(myElement,myimgs);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/factorialize-a-number