发表更新几秒读完 (大约98个字)0次访问
前端实践-密码验证
前端实践-密码验证
静态文件
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
|
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Password Verification</title> <style> body { font-family: Arial, sans-serif; text-align: center; } input[type="password"] { padding: 10px; margin: 10px; } button { padding: 10px 20px; margin: 10px; cursor: pointer; } </style> </head> <body> <h2>Password Verification</h2> <input type="password" id="password" placeholder="Enter password"> <button onclick="verifyPassword()">Verify Password</button> <p id="message"></p>
<script> function verifyPassword() { var password = document.getElementById("password").value; if (password === "MyPassword") { window.location.href = "14qBrMavy2pW9umzuhd7eMDVpwQ62xRtPK.html"; } else { document.getElementById("message").innerHTML = "Incorrect password. Please try again."; } } </script> </body> </html>
|