Create a weight converter. Body mass index bmi is a measure of body fat based on height and weight that applies to adult men and women. Select compute bmi and your bmi will appear below. Screen shot of bmi calculator. Create an input element that can convert a value from one weight measurement to another. In the metric system bmi is calculated with the following formula.
Returns a string the text to display and use it like this. Bmi mass kg height 2 m for you guys who are using the imperial measurement system simply multiply it by 703. Enter your weight and height using standard or metric measures. Calculate your body mass index. Script languagejavascript function calculatebmi var weight documentbmiformweightvalue var height documentbmiformheightvalue if weight 0 height 0 var finalbmi weight height100height100 documentbmiformbmivalue finalbmi if finalbmi 185 documentbmiformmeaningvalue that you are too thin. Returns a number the bmi function bmitohealthbmi todo determine what text to display based on the bmi value.
Step 1 add html. Bmi 703 x mass lbs height 2 in the resulting bmi will indicate whether a person is underweight just right or overweight. Script for bmi calculator. Function calculatebmiheight weight todo calculate bmi based on height and weight passed in. Bmi w h100 h100 where w is weight in kg and h stands for height in centimeter.