topical media & game development

talk show tell print

lib-js-math-calculator-bmi-metric.htm / htm

    1.  Copy the coding into the HEAD of your HTML document
    2.  Add the last code into the BODY of your HTML document  -->
  <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
  <script type="text/javascript">
  <!-- This script and many more are available free online at -->
  <!-- The JavaScript Source!! -->
  <!-- Created by: Bob Mason :: -->
  <!-- Begin
  function  calculateBMI() {
    var weight = eval(document.form.weight.value)
    var height = eval(document.form.height.value)
    var height2 = height / 100
    var BMI = weight  / (height2 * height2)
  function custRound(x,places) {
    return (Math.round(x*Math.pow(10,places)))/Math.pow(10,places)
  // End -->
  <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
  <div align="center">
  <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">
  <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
  by <a href="">The JavaScript Source</a></font>
  <!-- Script Size:  1.61 KB -->

(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.