-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJS_012_ If Statement.html
46 lines (39 loc) · 1.05 KB
/
JS_012_ If Statement.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>JavaScript</title>
<!-- THE SYNTAX IS BELOW THIS IS HOW THE IF STATEMENT IS SUPPOSE TO BE WRITTEN
if(expression){
Content that needs to be evaluated
}
-->
<script>
/* Greater Than If Condition */
var a = 100;
var b = 20;
if(a > b) {
document.write("A is Greater");
}
document.write("<br><br>");
/* Equal to If Condition */
var m = 100;
var n = 100;
if (m == n) {
document.write("A is Greater");
}
document.write("<br><br>");
/* Equal value and equal type If Condition */
var x = 100;
var y = "100";
if (x === y) {
document.write("BT-zack");
}
document.write("<br><br>");
</script>
</head>
<body>
</body>
</html>