
document.getElementById("answer").value = output If (output = 18.5 & output = 25 & output 30)ĭocument.getElementById("comment").innerText = "Overweight" Var BMI = Math.round(weight / Math.pow(height, 2) * 10000) ĭocument.getElementById("output").innerText = Math.round(BMI * 100) / 100 var BMI = weight /Math.pow(height, 2)*10000 Var weightunits = document.getElementById("weightunits").value Var weight = Number(document.getElementById("weight").value) Var heightunits = document.getElementById("heightunits").value Var height = Number(document.getElementById("height").value) If (output=18.5 & output=25 & output30)ĭocument.getElementById("comment").value = "Overweight" ĭocument.getElementById("answer").value = output Var weightunits=document.getElementById("weightunits").value Var weight=Number(document.getElementById("weight").value) Var heightunits=document.getElementById("heightunits").value Var height=Number(document.getElementById("height").value) Please can someone help me fix my calculator, I know there are problems with my if statements? Thanks. There should be a message shown underneath: your bmi is:, and then the message underneath is this means you are: according to the BMI calculated above. Please seek further advice from your GP.I am trying to create a basic HTML/JavaScript BMI calculator. If you're suffering from an eating disorder, the BMI calculator results do not apply. Your can use your BMI result as a starting point for further discussion with your GP about your weight and your general health.įind out more in How your GP can help and check out the Change4Life website for practical tips on staying healthy as a family. However, the BMI is a relatively straightforward and convenient method of assessing someone's weight.
#Bmi to weight converter how to#
Get tips on how to encourage your child to be more active and eat well


For children and young people aged two to 18, the BMI calculator takes into account age and gender as well as height and weight.
