Created
August 16, 2017 15:47
-
-
Save Tebreca/3e3d10ba10c3993acbcb49057ee078b5 to your computer and use it in GitHub Desktop.
quick HTML and JS login page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>eaglOS login</title> | |
<link rel="stylesheet" href="styles/login.css"> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
</head> | |
<body> | |
<div class="container"> | |
<form name="login"> | |
<div class="Iinput">Username</div> | |
<input class="Iinput" type="text" id="username"> | |
<div class="Iinput">Password</div> | |
<input class="Iinput" type="password" id="password"><br> | |
<button type="button" onclick="testtrue();" name="loginbutton">login</button> | |
</form> | |
</div> | |
<script> | |
function testtrue(){ | |
var Usname = document.getElementById("username").value; | |
var passW = document.getElementById("password").value; | |
var lengthun = document.getElementById("username").length; | |
var lengthpw = document.getElementById("password").length; | |
if (Usname === "Test" && passW === "test"){ | |
window.location.replace("./users/ewan/desktop.html"); | |
}else { | |
console.log("password: " + passW + " isn't valid!!"); | |
} | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Css: