What is wrong with this HTML file <title>Email</title> </head> <body> <style> bo
ID: 3827612 • Letter: W
Question
What is wrong with this HTML file
<title>Email</title>
</head>
<body>
<style> body {background-color: #FF0000}</style>
<center><img src="logo.png"></center>
" <form name="login form">
email id <input type="email" name="email"><br><br>
password <input type="password" name="pass"><br><br>
<input type="submit" value="login">
</form>
</body>
</html>
<script type="text/javascript">
function validation()
{
var x = document.form["login form"]["email"].value;
var y = document.form["login form"]["pass"].value;
if(x===null|| x===""|| y===null|| y==="")
{alert("email id or password is blank")};
var x1= document.form["login form"]["java"].value;
var y1=document.form["1234"].value;
if(x1==="java"&& y1==="1234")
{alert("successful login");
}
else
{confirm("wrong username and/or password");}}
</script>"
Explanation / Answer
<title>Email</title>
</head>
<body>
<style> body {background-color: #FF0000}</style>
<!-- <center><img src="logo.png"></center> -->
<form name="login_form">
email id <input id="emaila" type="email" name="email" ><br><br>
password <input id="epassword" type="password" name="pass"><br><br>
<input type="submit" value="login">
</form>
</body>
</html>
<script type="text/javascript">
function validation()
{
var x = document.forms["login_form"]["email"].value;
var y = document.forms["login_form"]["pass"].value;
// var x= document.getElementById("emaila").value;
// var y = document.getElementById("epassword").value;
// alert(y);
if(x===null|| x===""|| y===null|| y==="")
{
alert("email id or password is blank");
}
var x1= document.forms["login_form"]["email"].value;
var y1=document.forms["login_form"]["pass"].value;
if(x==="java@ab.com"&& y==="1234")
{ alert("successful login");
}
else
{
confirm("wrong username and/or password");
}
}
</script>
enter the username :java@ab.com
and password :1234
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.