-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
48 lines (42 loc) · 973 Bytes
/
script.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function result() {
var djk = (document.getElementById(
"ashu").value / (document
.getElementById("divyanshu")
.value *
document.getElementById(
"divyanshu")
.value));
var ashuk = document.getElementById(
"Equal").value += djk;
if (ashuk <= 18) {
alert("Khaya-piya kro thoda = You are Malnutrite ")
} else if (ashuk >= 25) {
alert(
"Kha kha ke mote ho gaye ho. You are Overweight."
)
} else if (ashuk >= 18.5 && ashuk<=25) {
alert("Your are Healthy")
} else {
alert("Enter data")
}
}
//variables
let R, G, B;
let randomR, randomG, randomB;
//function that changes the background color
function color() {
randomR = Math.floor(Math.random() *
256);
randomG = Math.floor(Math.random() *
156);
randomB = Math.floor(Math.random() *
256);
R = randomR;
G = randomG;
B = randomB;
document.body.style
.backgroundColor =
'rgb' + '(' + R + ',' + G + ',' +
B +
')';
}