Beginner
FizzBuzz on the page
When Run is clicked, read the number n from the input and fill the list #out with one <li> for each number from 1 to n.
Each item shows Fizz if the number divides by 3, Buzz if it divides by 5, FizzBuzz if it divides by both, and the number itself otherwise.
Clicking again must replace the list, not add to it.
What Check tests
- Running with 15 makes exactly 15 items
- Plain numbers, Fizz and Buzz are right
- 15 shows FizzBuzz
- Clicking again replaces the list
- A different n works (n = 5)
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.