const spinner = document.createElement("div"); | |
spinner.classList.add("spinner"); | |
["ball-1", "ball-2", "ball-3", "ball-4"].forEach(ballNumber => { | |
const ball = document.createElement("div"); | |
ball.classList.add("ball"); | |
ball.classList.add(ballNumber); | |
spinner.appendChild(ball); | |
}); | |
document.body.appendChild(spinner); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment