-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
50 lines (50 loc) · 1.31 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Flock Project</title>
<style>
.guess,
.form {
text-align: center;
}
</style>
</head>
<body>
<div class="guess">
<h1>Guess the Number</h1>
<button onclick="guessNumber()">Guess</button>
</div>
<br />
<br />
<br />
<div class="form">
<h1>Basic Form</h1>
<form>
First Name: <input type="text" /> Last Name: <input type="text" />
<br />
UserName: <input type="text" /> Email: <input type="email" />
<br />
Password: <input type="password" />
<br />
<br />
<button type="reset">Reset</button>
<button type="submit">Submit</button>
</form>
</div>
<script>
function guessNumber() {
const random = Math.floor(Math.random() * 10) + 1;
let num = parseInt(prompt("Guess a number from 1 to 10"));
while (num != random) {
num = parseInt(prompt("Incorrect Guess! Want to try again?"));
}
if (num == random) {
alert("That is the right number!!");
}
}
</script>
</body>
</html>