JSFiddle - React, Tailwind, and code Playground

by Julien Etienne

HTML

<!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>Alert test</title>
<script>
	  const corr_uname = "admin", corr_pass = "admin";
    
    function authenticate() {        
        const uname = prompt("Enter Username: ");
        const pass = uname && prompt("Enter Password: ");
        const isCredentialsValid = uname == corr_uname && (pass == corr_pass);
        const accessType = isCredentialsValid ? 'Granted' : 'Denied';
        alert(`Access ${accessType}!!`);
    }
    authenticate();
</script>
</head>
<body>
<h1>Welcome!</h1>
</body>
</html>