-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpractice3.html
39 lines (31 loc) · 1.18 KB
/
practice3.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
<!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">
<link rel="stylesheet" href="style.css">
<title>Problem 3</title>
</head>
<body>
<h1>Problem 3</h1>
<label for="password">Enter Password:</label>
<input type="password" id="password" placeholder="Enter your password">
<label for="confirmPassword">Confirm Password:</label>
<input type="password" id="confirmPassword" placeholder="Confirm your password">
<button onclick="verifyPassword()">Verify</button>
<script>
function verifyPassword() {
const password = document.getElementById("password").value;
const confirmPassword = document.getElementById("confirmPassword").value;
if (password.length < 8) {
alert("Password must be at least eight characters long.");
} else if (password !== confirmPassword) {
alert("Passwords do not match. Please try again.");
} else {
alert("Passwords match!");
}
}
</script>
</body>
</html>