Best matchBasic Calculator
Read form values and use them in the project logic.
Build a basic calculator →Build a bmi calculator with HTML, CSS, and JavaScript while practicing click events and DOM selection.
Build a bmi calculator using HTML, CSS, and JavaScript, then connect the interface to the logic that makes it work. You’ll learn how to take user input, perform a calculation, and display a clear result while getting hands-on practice with click events, DOM selection, and DOM content updates.
Recommended knowledge: Basic HTML and CSS, JavaScript variables and number operations, DOM selection and form events, DOM selection and click 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>BMI Calculator</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1 class="heading">Body Mass Index (BMI) Calculator</h1>
Your Height (cm):
<input type="number" class="input" id="height" value="180" placeholder="Enter your height in cm">
Your Weight (kg):
<input type="number" class="input" id="weight" value="80" placeholder="Enter your weight in kg">
<button class="btn" id="btn">Compute BMI</button>
<input disabled type="text" class="input" id="bmi-result">
<h4 class="info-text">Weight Condition: <span id="weight-condition"></span></h4>
</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 basic calculator →Turn JavaScript calculations into clear visual results.
Build an age calculator →
Use conditions to control how the interface behaves.
Build a number counter →
Read form values and use them in the project logic.
Build a basic calculatorTurn JavaScript calculations into clear visual results.

Use conditions to control how the interface behaves.