Build a Click Counter in 10 Minutes
A mini project combining DOM, events, and variables.
Combine a button, a counter variable, and an event listener.
let count = 0;
btn.addEventListener("click", () => {
count++;
display.textContent = count;
});Try this in the playground, then on your own HTML page.