-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpassword1.html
More file actions
50 lines (42 loc) · 1.37 KB
/
password1.html
File metadata and controls
50 lines (42 loc) · 1.37 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
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Password Checker</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600&display=swap');
body{
font-family:"Outfit",serif;
}
</style>
</head>
<body>
<h1>Password Strength Checker</h1>
<br>
<label for="passwordstrength">Enter Password::</label>
<input type="password" id="password" name="password" placeholder="Enter password" oninput="passwordchecker()">
<div id="strengthbar" class="strengthbar"></div>
<p id="strengthtext" class="strengthtext"></p>
</body>
<script>
function passwordchecker(){
let password=document.getElementById("password").value;
let strengthbar=document.getElementById("strengthbar");
let strengthtext=document.getElementById("strengthtext");
let strength=0;
if (password.length >= 8) {
strength += 1;
}
if (/\d/.test(password)) {
strength += 1;
}
if (/[A-Z]/.test(password)) {
strength += 1;
}
if (/[!@#$%^&*(),.?":{}|<>]/.test(password)) {
strength += 1;
}
}
</script>
</html>