1let imageArray =new Array();
2
3imageArray.push("images/dice1.png");
4imageArray.push("images/dice2.png");
5imageArray.push("images/dice3.png");
6imageArray.push("images/dice4.png");
7imageArray.push("images/dice5.png");
8imageArray.push("images/dice6.png");
9
10
11function randomGen(){
12 let randomVar=Math.ceil(Math.random()*6) ;
13 return randomVar;
14}
15
16document.querySelector("#dice1").lastElementChild.setAttribute("src",imageArray[randomGen()]);
17