p
Size: a a a
p
L
L
L
p
const hex = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'];
const btn = document.getElementById('btn');
const color = document.querySelector('.color');
btn.addEventListener('click', () => {
let hexColor = '#';
for (let x = 0; x < 6; x += 1) {
hexColor += hex[getRandomNum()];
}
color.textContent = hexColor;
document.body.style.backgroundColor = hexColor;
});
const getRandomNum = () => Math.floor(Math.random() * hex.length);
S
const hex = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'];
const btn = document.getElementById('btn');
const color = document.querySelector('.color');
btn.addEventListener('click', () => {
let hexColor = '#';
for (let x = 0; x < 6; x += 1) {
hexColor += hex[getRandomNum()];
}
color.textContent = hexColor;
document.body.style.backgroundColor = hexColor;
});
const getRandomNum = () => Math.floor(Math.random() * hex.length);
OM
N
L
const hex = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'];
const btn = document.getElementById('btn');
const color = document.querySelector('.color');
btn.addEventListener('click', () => {
let hexColor = '#';
for (let x = 0; x < 6; x += 1) {
hexColor += hex[getRandomNum()];
}
color.textContent = hexColor;
document.body.style.backgroundColor = hexColor;
});
const getRandomNum = () => Math.floor(Math.random() * hex.length);
(Math.random()*0xFFFFFFFFFF).toString(16).slice(0, 6)
OM
L
L
OM
p
(Math.random()*0xFFFFFFFFFF).toString(16).slice(0, 6)
L
L
OM
p
OM
p