bmi calculator
<div> <form name="techBMI"> <h3>BMI Calculator</h3> <br/> <input type="text" name="weight" placeholder="Enter Weight (kg)" size="20"><br /><br/> <input type="text" name="height" placeholder="Enter Height (Meters)" size="20"><br /><br/> <input class="decoration-one px-3 py-2" type="button" value="Calculate BMI" onClick="calculateBmi()"><br /><br/> <input type="text" name="bmi" placeholder="Your BMI Will be here" size="20"><br /><br/> <input type="text" name="meaning" size="35"><br /><br/> <input class="decoration-one px-3 py-2" type="reset" value="Reset" /> <br/> </form> </div>
Source: tech.pathgriho.com
how to calculate bmi
function calculateBMI(height, weight) { return weight / height ** 2 } console.log(calculateBMI(1.8, 70))