Best matchNumber Counter
Read form values and use them in the project logic.
Build a number counter →Build an age calculator with HTML, CSS, and JavaScript while practicing click events and DOM selection.
This project shows you how HTML, CSS, and JavaScript work together in an age calculator. You’ll take user input, perform a calculation, and display a clear result, then practice click events, DOM selection, and DOM content updates as you build the complete project from scratch.
Recommended knowledge: Basic HTML and CSS, The JavaScript Date object, JavaScript variables and number operations, DOM selection and form events.
This project runs directly in the browser with HTML, CSS, and JavaScript.
index.html<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Age Calculator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>Age Calculator</h1>
<div class="form">
<label for="birthday">Enter you date of birth</label>
<input type="date" id="birthday" name="birthday">
<button id="btn">Calculate Age</button>
<p id="result">Your age is 21 years old</p>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
Practice input values, javaScript calculations, and conditional logic with these related projects.
Best matchRead form values and use them in the project logic.
Build a number counter →
Turn JavaScript calculations into clear visual results.
Build a basic calculator →
Use conditions to control how the interface behaves.
Build a bmi calculator →
Read form values and use them in the project logic.
Build a number counter
Turn JavaScript calculations into clear visual results.

Use conditions to control how the interface behaves.