»
EnglishFrenchVietnamese

Print - Metric BMI Calculator - JavaScriptBank.com

Full version: jsB@nk » Calculation » Metric BMI Calculator
URL: https://www.javascriptbank.com/metric-bmi-calculator.html

Metric BMI Calculator © JavaScriptBank.comUse this JavaScript to calculate your BMI (Body Mass Index). Measurements are computed using the metric system. A perfect addition for a health Web site.

Full version: jsB@nk » Calculation » Metric BMI Calculator
URL: https://www.javascriptbank.com/metric-bmi-calculator.html



JavaScript
<script type="text/javascript"><!-- Created by: Bob Mason--><!-- Beginfunction  calculateBMI() {  var weight = eval(document.form.weight.value)  var height = eval(document.form.height.value)  var height2 = height / 100  var BMI = weight  / (height2 * height2)  document.form.BodyMassIndex.value=custRound(BMI,1);}function custRound(x,places) {  return (Math.round(x*Math.pow(10,places)))/Math.pow(10,places)}// End --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form  name="form" id="form"><input type="Text" name="weight" size="4"> Weight (in Kilos)  <input type="Text" name="height" size="4"> Height (in Centimeters)<br><br><input type="Text" name="BodyMassIndex" id="BodyMassIndex" size="4"> BMI     <input type="button" style="font-size: 8pt" value="Calculate" onClick="calculateBMI()" name="button"><input type="reset" style="font-size: 8pt" value="Clear Form"></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->