-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecisions_loop.html
More file actions
37 lines (34 loc) · 902 Bytes
/
Copy pathdecisions_loop.html
File metadata and controls
37 lines (34 loc) · 902 Bytes
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
<!doctype html>
<html>
<body>
<h1>Decisions and Loops</h1>
<script>
var username;
username = prompt("What is ur name?");
/*
if (username == "Surya")
alert("Great name!");
/*
/*
else if (username == "Deva")
alert("Pretty good name");
else if (username == "Shiva")
alert("Pretty good name");
else
alert("Your name isn't great, Never Mind!"); */
switch (username) {
case "Navya":
alert("Your name is pretty good");
break;
case "deepa":
alert("you have awesome name");
break;
case "Sashi":
alert("Wow! Superb name");
break;
default:
alert("Please change your name");
}
</script>
</body>
</html>