HTML Lab Manual
HTML Lab Manual
AIM:
To create a web page which includes a map and display the related information when a hot spot is
clicked in the map.
PROCEDURE:
1. Create a html file with map tag.
2. Set the source attribute of the img tag to the location of the image and also set the use map
attribute.
3. Specify an area with name, shape and href set to the appropriate values.
4. Repeat step 3 as many hot spots you want to put in the map.
5. Create html files for each and every hot spot the user will select.
Imagemap.html
<HTML>
<HEAD>
<TITLE>Image Map</TITLE> </HEAD>
<BODY>
<img src="./img/india_map.jpg" width="700" height="600" alt="IndiaMap" usemap="#indiamap">
<map id="indiamap" name="indiamap">
<area href="tamilNadu.html" shape="circle"
coords="308,506,40" title="TamilNadu"/>
<area href="karnataka.html" shape="rect" coords = "215,410,225,485" title ="Karnataka" />
<area href="kerala.html" shape="poly" coords =
"587,390,438,411,430,536,248,535,202,503" title ="Kerala" />
<area href="andhra.html" shape="rect" coords = "285,410,335,485" title ="Andhra Pradesh" />
</map>
</BODY>
</HTML>
Tamilnadu.html
<HTML>
<HEAD>
<TITLE>About Tamil Nadu</TITLE>
</HEAD>
<BODY>
<CENTER><H1>Tamil Nadu</H1></CENTER> <HR>
<UL>
<LI>Area : 1,30,058 Sq. Kms.</LI>
<LI>Capital : Chennai</LI>
<LI>Language : Tamil</LI>
<LI>Population : 6,21,10,839</LI> </UL><hr>
<a href='ImageMap.html'>India Map</a>
</BODY>
</HTML>
Kerala.html
<HTML>
<HEAD>
<TITLE>About Kerala</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>Kerala</H1></CENTER>
<HR>
<UL>
<LI>Area : 38,863 Sq. Kms.</LI>
<LI>Capital : Thiruvananthapuram</LI>
<LI>Language : Malayalam</LI>
<LI>Population : 3,18,38,619</LI>
</UL>
<hr>
<a href='ImageMap.html'>India Map</a>
</BODY>
</HTML>
Andhra.html
<HTML>
<HEAD>
<TITLE>About Andhra Pradesh</TITLE> </HEAD>
<BODY>
<CENTER><H1>Andhra Pradesh</H1></CENTER> <HR>
<UL>
<LI>Area : 2,75,068 Sq. Kms</LI>
<LI>Capital : Hyderabad</LI>
<LI>Language : Telugu</LI>
<LI>Population : 7,57,27,541</LI>
</UL>
<hr>
<a href='ImageMap.html'>India Map</a>
</BODY>
</HTML>
Karnata.html
<HTML>
<HEAD>
<TITLE>About Karnataka</TITLE> </HEAD>
<BODY>
<CENTER><H1>Karnataka</H1></CENTER>
<HR>
<UL>
<LI>Area : 1,91,791 Sq. Kms</LI>
<LI>Capital : Bangalore</LI>
<LI>Language : Kannada</LI>
<LI>Population : 5,27,33,958</LI>
</UL>
<hr>
<a href='ImageMap.html'>India Map</a>
</BODY>
</HTML>
RESULT:
Thus the creation of a web page which includes a map and display the related in-formation when a
hot spot is clicked in the map was executed successfully.
PROGRAM:
XYZ.CSS:
h3
{
font-family:arial;
font-size:20;
color:cyan
}
table{
border-color:green
}
td
{
font-size:20pt;
color:magenta
}
PROGRAM :
<html>l
<head>
<title> ONLINE BOOK STORES</title>
</head>
<body bgcolor="lemonchiffon">
<marquee><h1 align=”center”><b><u><font color="darkolivegreen">
ONLINE BOOK STORAGE</u></font>
</b></h1></marquee>
<H2 ALIGN="CENTER">
<b><p><U><FONT COLOR="PURPLE">Welcome to online book storage.
Press login if you are having id otherwise press
registration.</U></FONT></p></b></H2>
<H2> <FONT COLOR="darkolivegreen"></FONT></H2>
<H3 ALIGN="CENTER">
<BR><BR><A HREF="login.html"><FONT COLOR="black"><ITALIC>USER
LOGIN</FONT></ITALIC><BR>
<A HREF="reg.html"><BR><BR><FONT
COLOR="black"><ITALIC>REGISTRATION
FORM</FONT></ITALIC><BR><BR>
<BR><BR><A HREF="payment.html"><FONT
COLOR="black"><ITALIC>PAYMENT</FONT></ITALIC><BR>
</body>
</html
Login.html
<html>
<head>
<title>Login</title>
<script>
function validate() {
if(document.getElementById('uname').value==""
||document.getElementById('pwd').value=="")
{
alert("LoginId and Password must be filled")
}
}
</script>
</head>
<body bgcolor="lavender"><br><br><br>
<form name=”myform”>
<div align=”center”><pre>
USER NAME:<input type='text' id="uname" name='uname'><br>
PASSWORD:<input type='password' id="pwd" name='pwd'>
<br><br>
</pre>
<button onclick="validate()">Login</button>
<input type='reset' value='clear' />
</div>
</form>
</body>
</html>
Registration form:
<Html>>
<head>
<title>
Registration Page
</title>
</head>
<body bgcolor="Lightskyblue">
<br>
<div align="CENTER"> <h1>REGISTRATION FORM</h1></div>
<br>
<form>
<div align=”center”>
<table align="center">
Payment.html:
<html>
<head>
<title>Payment</title>
<script>
function validate() {
if(document.getElementById('uname').value==""
||document.getElementById('pwd').value=="")
{
alert("LoginId and Password must be filled");
document.getElementById('uname').focus();
return;
}
if(document.getElementById('amount').value=="")
{
alert("Amount should not be empty");
document.getElementById('amount').focus();
return;
}
if(document.getElementById('cardnum').value=="")
{
alert("Card number should not be empty");
document.getElementById('cardnum').focus();
return;
}
var flag=1;
var amnt=document.getElementById('amount').value;
if(isNaN(amnt)){
alert("Amount should be numeric");
return;
}
var cardnum=document.getElementById('cardnum').value;
if(isNaN(cardnum)){
alert("Card number should be numeric");
return;
}
if(cardnum.length < 10){
alert("Card number should be 10 digit");
return;
}
}
</script>
</head>
<body bgcolor="darkseagreen"><br><br><br>
<form name=”paymentform”>
<div align="CENTER"> <h1>PAYMENT</h1></div>
<div align=”center”><pre>
<table align="CENTER">
<tr><td>USER NAME:</td><td><input type='text' id="uname"
name='uname'></td></tr>
<tr><td>PASSWORD:</td><td><input type='password' id="pwd"
name='pwd'></td></tr>
<tr><td>AMOUNT:</td><td><input type="text" name="amount"
id="amount"></td></tr>
<tr><td>CREDITCARDNUMBER:</td><td><input type="PASSWORD"
name="cardnum" id="cardnum"></td></tr>
<tr></tr>
<tr></tr>
<tr></tr>
</table>
</div>
<div align="CENTER"> <button onclick="validate()">PAY</button>
<input type='reset' value='CANCEL' /></div>
</form>
</body>
</html>
Ouput:
RESULT:
Thus the web page for online book store is created and its WebPages are
validated using JavaScript.