JavaScript · Exercise 1 of 6Next
Beginner
A click counter with reset
Make the +1 button add one to the number in #count each time it is clicked, and the Reset button set it back to 0.
Use addEventListener, not onclick attributes in the HTML.
What Check tests
- Clicking +1 adds one
- Clicking +1 three times adds three
- Reset shows 0
- Counting starts again from 0 after a reset
- Uses addEventListener
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.