Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Improved Authenticator</title>
<!-- <style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
#response {
font-size: 18px;
font-weight: bold;
text-align: center;
padding: 20px;
border-radius: 5px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
</style> -->
</head>
<body>
<!-- Create an area for display on the web page -->
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
#response {
font-size: 18px;
font-weight: bold;
text-align: center;
padding: 20px;
border-radius: 5px;
background-color: #fff;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
</style>
<p id="response"></p>
<script>
let userName = prompt("Enter user name");
let password = prompt("Enter password");
const authenticator = function(userName, password) {
if (userName == "admin") {
if (password=="secret") {
return "Welcome Admin";
}
}
return "Bad Login Credentials";
}
let refToDisplayArea = document.querySelector("#response");
refToDisplayArea.textContent = authenticator(userName, password);
</script>
</body>
</html>