I could not complete it but i'd still say it is still a lot of improvement on my JS skill. When i click button, i was able to get rbg(randomNumber *3) in console.
const btn = document.getElementById("btn");
const main = document.getElementById("main");
btn.addEventListener("click", randomColor);
function randomColor(e) {
randomNumber = Math.round(Math.random() * 255);
const rgb = `rgb(${randomNumber} , ${randomNumber} , ${randomNumber})`;
console.log(rgb);
}

Comments
Post a Comment