JavaScript : Calculate BMI function

By seisfun

function calculateBMI(thisform)
{
with (thisform)
{
var height = txtHeight.value;
var weight = txtWeight.value;
var bmi = 0;

bmi = weight / (height*height);

alert(“YOUR BMI : ” + bmi);
}
}

Leave a Reply