- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswitch.html
More file actions
Latest commit
42 lines (34 loc) · 1.06 KB
/
Copy pathswitch.html
File metadata and controls
42 lines (34 loc) · 1.06 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
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<htmllang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<metacharset="utf-8" />
<title></title>
<scripttype="text/javascript">
varNumber;
Number=window.prompt("Please Enter a number:","1 - 5");
document.writeln("<h2>The number you entered is:</h2></br>"+Number);
Number1=parseFloat(Number);
switch(Number){
case"1":
break;
document.writeln("<h2>too low</h2>");
case"2":
document.writeln("<h2>too low</h2>");
break;
case"3":
document.writeln("<h2>You guessed the secret number</h2>");
break;
case"4":
document.writeln("<h2>too high</h2>");
break;
case"5":
document.writeln("<h2>too high</h2>");
break;
default:
document.writeln("<h2>You did not enter a number between 1 and 5</h2>");
}
</script>
</head>
<body>
</body>
</html>