-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbmi.html
79 lines (67 loc) · 2.28 KB
/
bmi.html
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="en">
<head>
<title>Graviton - The BMI calculator</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="offmu.css" type="text/css" />
<script>
function conclude() {
var resultedBMI=document.getElementById('bmi').value;
var theOutputBox = document.getElementById('conclusion');
if (resultedBMI < 16)
theOutputBox.innerHTML="Severely underweight";
else if (resultedBMI < 20)
theOutputBox.innerHTML= "Underweight";
else if (resultedBMI < 25)
theOutputBox.innerHTML= "Normal";
else if (resultedBMI < 30)
theOutputBox.innerHTML= "Overweight";
else if (resultedBMI < 35)
theOutputBox.innerHTML= "Obese";
else theOutputBox.innerHTML= "OH NOOOO!!!!";
return;
}
</script>
</head>
<body>
<header>
<p>
Officina Mutante presents
<hr />
<h1>Graviton</h1>
<h2>The awesome BMI* calculator</h2>
*Body Mass Index
</header>
<hr />
<form name="calc_form" id="theForm"
// bmi contains the calculated Index;
// ho and wo are needed to display the changed values of height and weight;
// meter1 is needed to display the changed meter value
oninput= "bmi.value =
(parseFloat(wi.value) /
((hi.value/100)*
(hi.value/100))).toFixed(1);
ho.value=hi.value;
wo.value=wi.value;
meter1.value=bmi.value;
conclude();">
<p>Insert your values below sliding the cursors
<p><label for="height">Your Height (Cm): </label>
<input type="range" name="height" id="hi" value = "170" min="100" max="250"> =
<output name="ho" for "hi wi"></output>
<p><label for="weigth">Your Weight (Kg): </label>
<input type="range" name="weight" id="wi" value = "70" min="40" max="150"> =
<output name="wo" for "wi"></output>
<p><label for="bmi" style="font-weight:bold;">Your BMI is
<output name="bmi" for "hi wi" id="bmi"></output>
<p><meter form = "theForm" id = "meter1" name="meter1"
min="6" max="150" low="20" high="30" optimum="25" value ="50">50%</meter>
<p><output name="conclusion" for "hi wi" id="conclusion" style="font-weight:bold;"></output>
</form>
<hr />
<footer>
<a href="https://sites.google.com/site/officinamutante/">
-- by Officina Mutante
<img src="offMu logoBW.png" alt="Officina Mutante logo" height="65px" width="58px">
</a>
</footer>