8 lines
224 B
JavaScript
8 lines
224 B
JavaScript
{5c52880637fc6361021bd24c4154a60b039226af true 224 script.js 0xc002bd6930}
const btn = document.getElementById("btn");
|
|
|
|
btn.addEventListener("click", () => {
|
|
document.body.style.background = randomBg();
|
|
});
|
|
function randomBg() {
|
|
return `hsl(${Math.floor(Math.random() * 360)}, 100%, 50%)`;
|
|
} |