mirror of
https://github.com/minoplhy/crappy-reverie.git
synced 2024-11-14 21:36:57 +00:00
10 lines
288 B
JavaScript
10 lines
288 B
JavaScript
function randomImageBroker(ElemName, imgArray) {
|
|
const imgEl = document.getElementById(ElemName);
|
|
randomImage(imgEl, imgArray)
|
|
|
|
}
|
|
|
|
function randomImage(imgELM, srcArray) {
|
|
const randomIndex = Math.floor(Math.random()*srcArray.length);
|
|
imgELM.src = srcArray[randomIndex];
|
|
} |