Build a Simple HTML Clicker Game for Kids
Let’s build a simple HTML clicker game for kids. You will make a web page where clicking a button earns points. This is a perfect first HTML + JavaScript project.
What you need
- A text editor (Notepad, VS Code, or an online sandbox)
- A browser (Chrome / Edge / Firefox)
Step 1: Create the file
Make a file named clicker.html and paste this starter:
<!DOCTYPE html>
<html>
<head>
<title>KidsKod Clicker</title>
<style>
body { font-family: Arial, sans-serif; text-align: center; background: #F8FAFC; }
button { font-size: 24px; padding: 12px 20px; border-radius: 999px; background: #FCD34D; border: none; cursor: pointer; }
#score { font-size: 32px; color: #227B9A; margin: 20px; }
</style>
</head>
<body>
<h1>KidsKod Clicker</h1>
<div id="score">Score: 0</div>
<button id="clickBtn">Click Me!</button>
<script>
let score = 0;
const scoreEl = document.getElementById("score");
document.getElementById("clickBtn").onclick = function () {
score = score + 1;
scoreEl.textContent = "Score: " + score;
};
</script>
</body>
</html>
Step 2: Play it
Open the file in your browser and click the button. Watch the score climb!
Step 3: Level-up ideas
- Change the button color every 10 clicks
- Add a “Reset” button
- Add a second button worth +5 points
- Show “High score!” when you reach 50
What you learned
HTML structure, CSS styling, JavaScript variables, and click events. From here you can invent more browser games on KidsKod.