0% found this document useful (0 votes)
47 views9 pages

Ex 5

The documents contain source code for an HTML login page and quiz application. The login page includes JavaScript validation for the name and password fields. The quiz application contains an HTML form with 10 multiple choice questions about HTML topics, and JavaScript code to calculate the quiz score and display it in an alert.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views9 pages

Ex 5

The documents contain source code for an HTML login page and quiz application. The login page includes JavaScript validation for the name and password fields. The quiz application contains an HTML form with 10 multiple choice questions about HTML topics, and JavaScript code to calculate the quiz score and display it in an alert.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Source Code:

Login.html

<html>
<head>
<title>QUIZ</title>
<script>
function validate() {
var name = document.forms.RegForm.Name.value;
var pw = document.forms.RegForm.Password.value;
var validName = /\d+$/g;
if (name == "") {
window.alert("Name should not be empty.");
name.focus();
return false;
}
else if(validName.test(name)){
window.alert("Name should be alphabet");
name.focus();
return false;
}
if (pw == "") {
window.alert("Password should not be empty.");
pw.focus();
return false;
}
alert("Login Successfully");
}
</script>
</head>
<body align="center">
<h2><b>Login form</b></h2>
<form name="RegForm" onsubmit="return validate();" method="post"
action="C:\Users\ELCOT\Desktop\MCA-WFE\login1.html">
<table border="0" height="10%" align="center">
<tr>
<th align="left"><label>Name </label></th>
<td><input type="text" name="Name"/></td>
</tr>
<tr>
<th align="left"><label>Password </label></th>
<td><input type="password" name="Password"/></td>
</tr>
</table> <br>
<input type="submit" value="LOGIN" name="Submit" />
</form>
</body>
</html>

Quizshare.html

<html>
<head>
<title>QUIZ</title>
<script type="text/javascript">
function result()
{
var score=0;
if(document.getElementById('correct1').checked)
{ score++;
}
if(document.getElementById('correct2').checked)
{ score++;
}
if(document.getElementById('correct3').checked)
{ score++;
}
if(document.getElementById('correct4').checked)
{ score++;
}
if(document.getElementById('correct5').checked)
{ score++;
}
if(document.getElementById('correct6').checked)
{ score++;
}
if(document.getElementById('correct7').checked)
{ score++;
}
if(document.getElementById('correct8').checked)
{ score++;
}
if(document.getElementById('correct9').checked)
{ score++;
}
if(document.getElementById('correct10').checked)
{ score++;
}
alert("Your score is:"+score);
var
wp="https://drive.google.com/drive/folders/1dHJWrYTpPsEk3gAbD5NJ8
_mF7MgUZ3Mx?usp=share_link";
window.open(wp)
}
</script>
</head>
<body bgcolor="pink">
<h2><center>HTML QUIZ APPLICATION</center></h2>
Q1.HTML stands for?<br>
<input type="radio" name="Question1" id="correct1">Hyper Text
Markup language<br>
<input type="radio" name="Question1">Hyper Text model
language<br>
<input type="radio" name="Question1">Hyper Text machine
lanuage<br>
<input type="radio" name="Question1">None of these<br>
Q2.CSS stands for?<br>
<input type="radio" name="Question2">Continuous style sheet<br>
<input type="radio" name="Question2" id="correct2">Cascading style
sheet<br>
<input type="radio" name="Question2">Cascade sheet style<br>
<input type="radio" name="Question2">None of these<br>
Q3.WWW stands for?<br>
<input type="radio" name="Question3">world web wide<br>
<input type="radio" name="Question3">wide web world<br>
<input type="radio" name="Question3" id="correct3">World wide
web<br>
<input type="radio" name="Question3">None of these<br>
Q4.WAN stands for?<br>
<input type="radio" name="Question4" id="correct4">Wide Area
Network<br>
<input type="radio" name="Question4">Wide Application
network<br>
<input type="radio" name="Question4">Wide Arduino
network<br>
<input type="radio" name="Question4">None of these<br>
Q5.LAN stands for?<br>
<input type="radio" name="Question5">Local Applicaion
network<br>
<input type="radio" name="Question5" id="correct5">Local Area
Network<br>
<input type="radio" name="Question5">local Arduino netwok<br>
<input type="radio" name="Question5">None of these<br>
Q6.Which Tag contains the meta information about the html
Page?.<br>
<input type="radio" name="Question6"><html><br>
<input type="radio" name="Question6" ><title><br>
<input type="radio" name="Question6" id="correct6"><head><br>
<input type="radio" name="Question6"><body><br>
Q7.Which tag is the root element of an HTML page?<br>
<input type="radio" name="Question7" id="correct7"><html><br>
<input type="radio" name="Question7" ><title><br>
<input type="radio" name="Question7"><head><br>
<input type="radio" name="Question7"><body><br>
Q8.Who invented HTML?
<input type="radio" name="Question8">Dave Ragget<br>
<input type="radio" name="Question8" id="coorect8" >Tim beners
lee<br>
<input type="radio" name="Question8">Dennis Ritchie<br>
<input type="radio" name="Question8">All the above<br>

Q9.Html tag with no content are called?<br>


<input type="radio" name="Question9">Special tags<br>
<input type="radio" name="Question9" >Adavnced tags<br>
<input type="radio" name="Question9" id="correct9">Empty
tags<br>
<input type="radio" name="Question9">Other Tags<br>
Q10.Which tag is used display a horizontal rule?<br>
<input type="radio" name="Question10"><br><br>
<input type="radio" name="Question10" id="correct10" ><hr><br>
<input type="radio" name="Question10"><hr>..</hr><br>
<input type="radio" name="Question10"><line><br>
<input type="submit" name="submit" value="SUBMIT QUIZ"
onclick="result()">
</head></html>
OUTPUT:

You might also like