Created
March 4, 2015 19:38
-
-
Save Bijesse/e6d3f8b7acea34aa368e to your computer and use it in GitHub Desktop.
Enter Your Credentials (simple) // source http://jsbin.com/najibawofi
This file contains hidden or 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> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> | |
<meta charset="utf-8"> | |
<title>Enter Your Credentials (simple)</title> | |
</head> | |
<body> | |
<div class="input-group"> | |
<!-- Change type to password --> | |
<input type="text" id="txtPass" | |
class="form-control" placeholder="Enter Password" /> | |
<span class="input-group-btn"> | |
<button class="btn btn-default" id="btnSubmit">Verify</button> | |
</span> | |
</div> | |
<script id="jsbin-javascript"> | |
// Set Password | |
var myPassword="password"; | |
// Set Hint / Nothing difficult to guesss | |
// Set 2 variables: one to track attempts and the other to track max amount of tries | |
var btnSubmit = document.getElementById("btnSubmit"); | |
btnSubmit.addEventListener("click", function(){ | |
var txtPass = document.getElementById("txtPass").value; | |
// Create a function | |
// that checks the passwords | |
// returns a boolean | |
if (txtPass === myPassword) { | |
alert("Welcome! To ...."); | |
} else { | |
alert("Not the Password!"); | |
return; | |
} | |
// increment amount of attempts made | |
}); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<script src="//code.jquery.com/jquery.min.js"><\/script> | |
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"><\/script> | |
<meta charset="utf-8"> | |
<title>Enter Your Credentials (simple)</title> | |
</head> | |
<body> | |
<div class="input-group"> | |
<\!-- Change type to password --> | |
<input type="text" id="txtPass" | |
class="form-control" placeholder="Enter Password" /> | |
<span class="input-group-btn"> | |
<button class="btn btn-default" id="btnSubmit">Verify</button> | |
</span> | |
</div> | |
</body> | |
</html></script> | |
<script id="jsbin-source-javascript" type="text/javascript">// Set Password | |
var myPassword="password"; | |
// Set Hint / Nothing difficult to guesss | |
// Set 2 variables: one to track attempts and the other to track max amount of tries | |
var btnSubmit = document.getElementById("btnSubmit"); | |
btnSubmit.addEventListener("click", function(){ | |
var txtPass = document.getElementById("txtPass").value; | |
// Create a function | |
// that checks the passwords | |
// returns a boolean | |
if (txtPass === myPassword) { | |
alert("Welcome! To ...."); | |
} else { | |
alert("Not the Password!"); | |
return; | |
} | |
// increment amount of attempts made | |
}); | |
</script></body> | |
</html> |
This file contains hidden or 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
// Set Password | |
var myPassword="password"; | |
// Set Hint / Nothing difficult to guesss | |
// Set 2 variables: one to track attempts and the other to track max amount of tries | |
var btnSubmit = document.getElementById("btnSubmit"); | |
btnSubmit.addEventListener("click", function(){ | |
var txtPass = document.getElementById("txtPass").value; | |
// Create a function | |
// that checks the passwords | |
// returns a boolean | |
if (txtPass === myPassword) { | |
alert("Welcome! To ...."); | |
} else { | |
alert("Not the Password!"); | |
return; | |
} | |
// increment amount of attempts made | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment