BMI Calculator is my first self project immediately after learning the Javascript.
Basically, you key in the weight and height, the script will calculate and return value known as BMI to user. BMI have a set of ranges that show user whether they are underweight range up to normal range and finally up to obese range.
*First of all, we use DOM to get values of textbox from user input.
*Using the formula BMI = Weight / (Height X Height), translate to code , we get:
var bmi = weightVal.value / Math.pow(heightVal.value,2);
*We fixed the trailing decimals to 2 decimal points by implementing toFixed functions:
bmiVal = bmi.toFixed(2);
*Lastly, we uses if ... else loop to compare the values and display relevant message of BMI values and relevant images back to user
Improvement Idea
(1) Reformat body with prettier CSS
(2) Include this awesome pics as it accurately depicts the actual

but it is a bit expensive for me to help support the geat artist here: iStock Human BMI