here's my code for the random colors
const colors = ["green", "red", "rgba(133,122,200)", "#f15025"];
const btn = document.getElementById('btn');
const color = document.querySelector('.color');
btn.addEventListener('click', function () {
console.log(document.body);
//get random number between 0 - 3
const randomNumber = getRandomNumber();
console.log(randomNumber);
document.body.style.backgroundColor = colors[randomNumber];
color.textContent = colors[randomNumber]
});
function getRandomNumber() {
return Math.floor(Math.random() * colors.length);
}
can somebody please tell me how to do the same thing but with picture;