-
Notifications
You must be signed in to change notification settings - Fork 0
/
arithmaticjs.html
108 lines (89 loc) · 2.21 KB
/
arithmaticjs.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html>
<head>
<style>
.main-container {
background-color: gray;
width: 60vw;
margin-left: 20vw;
height: 50vw;
display: flex;
flex-direction: column;
justify-content: flex-start;
}
.input-container {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.display {
background-color: bisque;
width: 100%;
height: 30%;
display: flex;
justify-content: center;
align-items: center;
font-size: 22px;
}
.input-box {
height: 44px;
width: 80%;
font-size: 22px;
}
.button {
width: 80%;
margin: 20px;
height: 44px;
background-color: lightgreen;
font-size: 22px;
}
</style>
<script>
// PROGRAM ONE
// function displayText(age) {
// let output = "half ticket";
// if(age <= 17){
// output= "half ticket";
// }
// if(age < 70){
// output= "half ticket";
// }
// document.getElementById("display").innerHTML = output;
// }
// PROGRAM TWO
// function displayText(age) {
// let output = "full ticket";
// if(age <= 17 || age >70) {
// output= "half ticket";
// }
// document.getElementById("display").innerHTML = output;
// }
//PROGRAM THREE
function displayText(dress, age) {
let output = "mount carmel";
if ((dress == "red" || dress == "white") && age > 14) {
output = "mount carmel";
} else {
output = "invalid";
}
document.getElementById("display").innerHTML = output;
}
function clearText() {
document.getElementById("display").innerHTML = "";
}
</script>
</head>
<body style="margin: 0px">
<div class="main-container">
<div class="display" id="display"></div>
<div class="input-container">
<input id="input" type="text" class="input-box" value="" />
<input id="input-one" type="number" class="input-box" value="" />
<button class="button" onclick="displayText('red' , 15)" onmouseleave="clearText()">
CLICK ME
</button>
</div>
</div>
</body>
</html>