-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs.js
30 lines (27 loc) · 852 Bytes
/
js.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function bmi(){
var h = document.getElementById('h').value;
var w = document.getElementById('w').value;
var bmi = w/(h/100*h/100);
var bmio=(bmi.toFixed(2));
document.getElementById('r').innerHTML="Your BMI is: "+bmio;
if(bmio<18.5)
{
document.getElementById('r').innerHTML="Your BMI is: "+bmio+" Under weight";
}
else if(bmio>18.5 && bmio<24.5)
{
document.getElementById('r').innerHTML="Your BMI is: "+bmio+" Normal weight";
}
else if(bmio>24.5 && bmio<29.5)
{
document.getElementById('r').innerHTML="Your BMI is: "+bmio+" Over weight";
}
else if(bmio>29.5 && bmio<34.5)
{
document.getElementById('r').innerHTML="Your BMI is: "+bmio+" Obese weight";
}
else if(bmio>34.5)
{
document.getElementById('r').innerHTML="Your BMI is: "+bmio+" Extremely Obese. If you want to live, you should loose your weight";
}
}