}
}
function drawBall(number, $parent) {
const $ball = document.createElement('div');
$ball.className = 'ball';
colorize(number, $ball); // 공을 생성할 때 색 지정
$ball.textContent = number;
$parent.appendChild($ball);
}
const setTimeoutPromise = (ms) => new Promise((resolve, reject) => {
setTimeout(resolve, ms);
});
let clickable = true;
$form.addEventListener('submit', async (event) => {
event.preventDefault();
if (!clickable) {
return;
}
clickable = false; // 클릭 제한
$result.innerHTML = '당첨숫자: ';
$bonus.innerHTML = '보너스숫자: ';
const string = event.target.input.value;
(중략)