-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTutorial17 If.html
More file actions
29 lines (29 loc) · 1.09 KB
/
Tutorial17 If.html
File metadata and controls
29 lines (29 loc) · 1.09 KB
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
<!doctype html>
<html>
<head>
<title>
Tutorial 17 JavaScript -- Conditional Statements
</title>
</head>
<body>
<script type="text/javascript"> // Tag to include JavaScript in HTML.
var variable1 = 5;
if(variable1 == 15){
document.write("Condition is True");
} else{
document.write("Condition is False");
}
(variable1 == 5) ? document.write("Condition is True") : document.write("Condition is False") // shorthand If.
/* Take aways - if (this Condition is true) then do this.
- There are various comparision operator in JavaScript
== --> is equal to.
==== --> is equal in both type and value.(Identity Opearator)
!= --> is not equal to
> --> is greater than.
< --> is less than.
>= --> is greater than or equal to
<= --> is less than or equal to
*/
</script>
</body>
</html>