html,body {
width: 100vw;
height: 100vh;
}
View Compiled
let getRandomColor = () => {
let characters = '0123456789ABCDDEF'
let color = '#'
for (let i = 0; i < 6; i++) {
color +=characters[getRandomNumber(0, 15)]
}
return color
}
let getRandomNumber = (min, max) => {
let r = Math.floor(Math.random() * (max - min + 1)) + min
return r
}
var color = getRandomColor()
document.body.style.backgroundColor = color;
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.