<!Doctype html> <html> <head> <title>page</title> <script type=\"text/javascript
ID: 3557595 • Letter: #
Question
<!Doctype html>
<html>
<head>
<title>page</title>
<script type="text/javascript">
function checkPass(){
var password=document.getElementById('password').value;
if(password=="yes")
{
alert('welcome');
window.open("http://www.google.com")
}
else
{
alert('wrong password');
}
}
</script>
<style type="text/css">
body{text-align:center}
</style>
</head>
<body>
<Form name="pwordcheck" action="">
Password:<input type="password" id="password" name="password" size="15">
<input type="button" value="submit"yes");">
</Form>
</body>
</html>
Explanation / Answer
// password validating using javaScript
<!Doctype html>
<html>
<head>
<title>page</title>
<script type="text/javascript">
function checkPass()
{
var password=document.getElementById("password").value;
if(password=="yes")
{
alert('welcome');
window.open("http://www.google.com")
}
else
{
alert('wrong password');
}
}
</script>
<style type="text/css">
body{text-align:center}
</style>
</head>
<body>
<form name="pwordcheck" action="">
Password:<input type="password" id="password" name="password" size="15">
<input type="button" value="Submit"/>
</form>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.