Tuesday, January 2, 2018
Simple HTML/Javascipt Div with Password
Javacsipt:
<script type="text/javascript">
function isValid(){
var keyvalue = document.getElementById('keyvalue').value;
if (keyvalue == "hcas")
{document.getElementById('divPassword').style.display = "block";}
else
{alert('ACCESS DENIED')}
}
</script>
HTML
<form name="PasswordField" action=""> Type Password Below:</br> <input type="text" id="keyvalue" name="keyvalue" onkeydown = "if (event.keyCode == 13) document.getElementById('subPass).click()"> <input type="button" id="subPass" value="ACCESS" onclick="isValid(this);"> </form> <div id="
divPassword" style="display:none;"> </br> <p>ACCESS GRANTED</p></br> This is password div </div>
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment