-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHOME.JS
More file actions
29 lines (26 loc) · 930 Bytes
/
HOME.JS
File metadata and controls
29 lines (26 loc) · 930 Bytes
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
document.querySelector(".btn").addEventListener("click" , function()
{
var clickSound = new Audio("sounds/click-sound.wav");
clickSound.play();
const heightValue = document.querySelector("#Height").value/100
const weightValue = document.querySelector("#Weight").value
const bmi = weightValue/(heightValue*heightValue);
const bmiinput = document.querySelector("#bmi-result");
bmiinput.value = bmi;
if(bmi<18.5)
{
document.querySelector("#weight-condition").innerHTML = "Under Weight";
}
else if(bmi>=18.5 && bmi<=24.9)
{
document.querySelector("#weight-condition").innerHTML = "Normal Weight";
}
else if(bmi>=25 && bmi<=29.9)
{
document.querySelector("#weight-condition").innerHTML = "Over Weight";
}
else if(bmi>=30)
{
document.querySelector("#weight-condition").innerHTML = "Obesity";
}
});