forked from Aniket965/Hello-world
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs.html
62 lines (38 loc) · 1.64 KB
/
js.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>TITLE</title>
<link rel="stylesheet" href="styles.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="container-fluid">
<div class="row">
<section class="one" id="about">
<div class="center">
<div>
<p>33. Write a JavaScript program to check if two numbers are in range 40..60 or in the range 70..100 inclusive. </p>
<input type="text" id="sum-one">
<input type="text" id="sum-two">
<button type="button" onclick="swap()">Swap</button>
<div id="answer"></div>
</div>
</div>
</section>
</div>
</div>
<script>
function swap() {
var sumOne = document.getElementById('sum-one').value;
var sumTwo = document.getElementById('sum-two').value;
if ((sumOne >= 40 && sumOne <= 60 || sumOne >= 70 && sumOne <= 100) || (sumTwo >= 40 && sumTwo <= 60 || sumTwo >= 70 && sumTwo <= 100)){
document.getElementById('answer').innerHTML = "In Range";
} else {
document.getElementById('answer').innerHTML = "Not In Range";
}
}
</script>
</body>
</html>