Session 1: 1. Write HTML Code To Develop A
Session 1: 1. Write HTML Code To Develop A
Session 1: 1.
Write HTML code to develop a Web page having the background in red and
title "My First Page" in any other color
Name Sujana Y. Enrolment No: 094545055
************************************************************************
<html>
<head>
<title>My First Page</title>
</head>
<body bgcolor=red text=yellow>
<center><b><u>My First Page</b></u></center>
</body>
</html>
************************************************************************
Session 1: 2.
Create an HTML document giving details of your name, age, telephone number,
address, TLC code & enrolment number aligned in proper order.
<div align="center">
<table border="0" width="50%">
<tr>
<td colspan="3" height="42">
<p align="center"><u><b>My Details</b></u></td>
</tr>
<tr>
<td width="42%" align="right"><b>Name</b></td>
<td width="3%" align="center"><b>:</b></td>
<td width="51%">Sujana</td>
</tr>
<tr>
<td width="42%" align="right"><b>Age</b></td>
<td width="3%" align="center"><b>:</b></td>
<td width="51%">23</td>
</tr>
<tr>
<td width="42%" align="right"><b>Telephone
Number</b></td>
<td width="3%" align="center"><b>:</b></td>
<td width="51%">+91-9480761007</td>
</tr>
<tr>
<td width="42%" align="right"
valign="top"><b>Address</b></td>
<td width="3%" align="center" valign="top"><b>:</b></td>
<td width="51%">
Gliyaru,<br> Japthi,<br>
Kundapura,<br>
Pin : 576211</td>
</tr>
<tr>
<td width="42%" align="right"><b>TLC Code</b></td>
<td width="3%" align="center"><b>:</b></td>
<td width="51%">1315</td>
</tr>
<tr>
<td width="42%" align="right"><b>Enrolment
Number</b></td>
<td width="3%" align="center"><b>:</b></td>
<td width="51%">094545055</td>
</tr>
</table>
</div>
</body>
</html>
************************************************************************
Session 1: 3.
Write an HTML code to design a page containing text, in form of paragraphs
giving suitable heading style
Name Sujana Enrolment No: 094545055
************************************************************************
<html>
<head>
<title>Basic of HTML ~ Paragraph</title>
</head>
<body bgcolor=white text=black>
<p align="justify">
HTML is used to define document structure and format, with the help of a
single tag<br>
or a pair of tags. A tag is a string in the language surrounded by a less
than (<) and a<br>
greater than (>) sign. An opening tag does not begin with a (/). An ending
or<br>
closing tag is a string that begins with slash (/).
</p>
<p align="justify">
HTML documents format textual information with embedded markup
tags that<br>
provide style and structure information. A whole document in HTML
begins with<br>
<HTML>and ends with</HTML>.</p>
<p align="justify"> </td>
</tr>
</table>
</div>
</body>
</html>
************************************************************************
Session 2: 1.
Create a page to show different attributes of Font tag.
<html>
<head>
<title>Anchor and Link Color</title>
</head>
<body alink=#FF3300 vlink=#800000 link=#0000FF>
<p align="center"><font size="5">This page demonstrates the use of <i>href
</i>Anchor tag and different anchor coloring attributes</font>
</p>
<p align="center"><a href="q1.html">Click to Open the Linked Page</a>
</p>
<p align="center"><a href="q2.html">Click to Open the Linked Page</a>
</p>
<p align="center"><a href="q3.htm">Click to Open the Linked Page</a>
</p>
</body>
</html>
************************************************************************
Session 4: 2.
Create a Web page, wherein when the user clicks on the link it should go to the bottom of the page.
</html>
************************************************************************
Session 5: 2.
Create a HTML document containing a nested list showing the content page of any book.
<li>Tables
<ol type="i">
<li>Table Tags</li>
<ol type="I">
<li>TD</li>
<li>TH</li>
<li>TR</li>
</ol>
<li>Cell Spacing and Cell Pading</li>
<li>Colspan and rowspan<li>
</ol>
</li>
<li>Frames
<ol type="i">
<li>Frameset</li>
<li>Frame Tag</li>
<li>No frame tag</li>
</ol>
</li>
</body>
</html>
************************************************************************
Session 5: 3.
Create a web page, showing a un ordered list of the names of five of your friend.
</html>
************************************************************************
Session 6: 1.
Create a Web page, which should contain a table having two rows and two columns.
************************************************************************
Session 6: 2.
Fill in some dummy data in the table created by you in question 1 of this session.
<html>
<head>
<title>Advance Table Exercise</title>
</head>
<body>
<table border="1" width="985" bordercolorlight="#000000"
bordercolordark="#000000" style="border-collapse: collapse">
<tr>
<td rowspan="2" width="148" valign="top">Name of train</td>
<td rowspan="2" valign="top" width="148">
<p align="left"> Place</td>
<td rowspan="2" valign="top" width="149">
Destination</td>
<td rowspan="2" valign="top" width="149"> Train No.</td>
<td colspan="2" valign="top"> Time</td>
<td rowspan="2" valign="top" width="89"> Fair</td>
</tr>
<tr>
<td valign="top" width="149"> Arrival</td>
<td valign="top" width="149"> Departure</td>
</tr>
<tr>
<td width="148" valign="top">Rajdhani Express</td>
<td valign="top" width="148">Sealdah</td>
<td valign="top" width="149">Delhi</td>
<td valign="top" width="149">2313</td>
<td valign="top" width="149">16-35</td>
<td valign="top" width="149">10-45</td>
<td valign="top" width="89">4,500</td>
</tr>
<tr>
<td width="148" valign="top">Darjeeling Mail</td>
<td valign="top" width="148">NJP</td>
<td valign="top" width="149">Sealdah</td>
<td valign="top" width="149">3144</td>
<td valign="top" width="149">08-50</td>
<td valign="top" width="149">19-35</td>
<td valign="top" width="89">1,500</td>
</tr>
<tr>
<td width="148" valign="top">Shatabdi</td>
<td valign="top" width="148">Howrah</td>
<td valign="top" width="149">Mumbai</td>
<td valign="top" width="149">2019</td>
<td valign="top" width="149">07-00</td>
<td valign="top" width="149">22-00</td>
<td valign="top" width="89">3,000</td>
</tr>
</table>
</body>
</html>
************************************************************************
Session 7: 1.
Create the following table <<<Table Graphics>>>
The style tags provide a straightforward way to control the font. These tags fall into
two categories: physical styles and logical styles.
Physical style tags allow you to specify a particular font change. For example, to make
text bold, you can mark it off with the <b> tag: <b>bold text</b>.
Logical Styles
At first glance, logical styles seem similar to physical styles:
<strong>: makes text strong.
<em>: makes text emphasized.
<cite>: marks off citations.
<code>: marks off computer code fragments and commands.
We might have noticed that the <strong< tag looks an awful lot like the <b> tag, the
<em> tag looks a lot like the <i> tag, and so on. However, there is a subtle difference
between the physical styles (such as <b> and <i>) and the logical styles (such as
<strong> and <em>).
************************************************************************
Session 8: 2.
Which HTML tag allows you to scroll text on the Web page?
When we use percentage instead of fixed pixel Sizes, the table will resize automatically
to fit any size browser window. Using percentage rather than fixed pixel sizes is
something that you should always do. This gives the browser the freedom to resize to
the users monitor settings, a freedom that does not exist when fixed size is used.
Example: The following HTML tags makes a table 500 pixel wide and 400 pixels high
<table width=“500” height=“400” >
To make the first cell of the table 20% of the total table width and the second cell 80% of
the table width, we would type the following :
<table> <tr><td width= “20%”> skinny cell </td>
<td width= “80%”> fat cell </td></tr> </table>
************************************************************************
Session 9: 2.
Write HTML code to generate the following output: <<<Table Graphics>>>
Name Sujana Y Enrolment No: 094545055
************************************************************************
<html>
<head>
<title>Advanced Table Creation</title>
</head>
<body>
<table border="1" width="985">
<tr>
<td width="245"> 1</td>
<td width="245"> 2</td>
<td width="245"> 3</td>
<td width="246"> 4</td>
</tr>
<tr>
<td width="245"> 5</td>
<td width="490" colspan="2" rowspan="2">
<img border="0" src="pound.gif" width="534" height="47"></td>
<td width="246"> 6</td>
</tr>
<tr>
<td width="245"> 7</td>
<td width="246"> 8</td>
</tr>
<tr>
<td width="245"> 9</td>
<td width="245"> 10</td>
<td width="245"> 11</td>
<td width="246"> 12</td>
</tr>
</table>
</body>
</html>
***********************************************************************************************
***********************
Session 9: 3.
Cerate a Web page that should contain a table having seven rows and four columns, along with the attributes -
colspan & rowspan.
<html>
<head>
<title>Advanced Table Creation</title>
</head>
<body>
<table border="1" width="100%" bordercolorlight="#FFFFFF"
bordercolordark="#000000" bordercolor="#000000">
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td rowspan="2"> </td>
<td> </td>
<td> </td>
<td rowspan="2"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td rowspan="2"> </td>
<td rowspan="2"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
<td> </td>
</tr>
</table>
</body>
</html>
***********************************************************************************************
***************************
Session 10: 1.
What are the different versions of HTML?
Name Krishna Prabhu Enrolment No: 094545291
***********************************************************************************************
Following are the different version of HTML
HTML 2.0
HTML 3.0
HTML 3.2
HTML 4.0
HTML 4.2
***********************************************************************************************
***************************
Session 10: 2.
List 5 different HTML Editors.
Name Krishna Prabhu Enrolment No: 094545291
***********************************************************************************************
***********************************************************************************************
***************************
Session 10: 3.
What is the different image formats?
Name Krishna Prabhu Enrolment No: 094545291
***********************************************************************************************
List of different image formats
JPEG
BMP
GIF
TIF
SECTION 2 (Advanced HTML)
************************************************************************
Session 1: 1.
How do you handle the situation when the browser doesn’t support frames?
Name Sujana Y Enrolment No: 094545055
************************************************************************
<NOFRAMES> tag used for display information when the browser doesn’t support
frames.
************************************************************************
Session 1: 2.
What are inline frames?
Name Sujana Y Enrolment No: 094545055
************************************************************************
Inline frames
Inline frames are similar to frames pages except that the inline frame and its contents
are embedded on an existing Web page. Anything that you can put on a regular page
you can put in an inline frame. You can customize inline frames in the same ways as
regular frames and also enable scroll bars.
One of the advantages of using inline frames is that you don't need to create a separate
frames page in order to have embedded content.
You can use inline frames in a variety of ways:
To insert a contract for your site visitor to fill out.
To give examples of what other Web pages look like.
As a container for a form (form: A set of data-entry fields on a page that are
processed on a Web server. The data is sent to the server when a site visitor
submits the form by clicking a button or, in some cases, by clicking a graphic.)
As a scrolling box with products and prices.
Add an inline frame to a page
1. In Page view, at the bottom of the document window, click Design.
2. On the Insert menu, click Inline Frame.
3. Set the initial page (initial page: The page that is initially displayed in a frame
when a site visitor browses to a frames page containing the frame. In FrontPage,
you can assign the initial page to a frame in Page view.) of the inline frame.
************************************************************************
Session 1: 3.
Which tag is used to define frames in HTML?
Name Sujana Y Enrolment No: 094545055
************************************************************************
<FRAMESET> tag define frames in HTML
Example:
<frameset col= “50%, 50%”>
<frameset rows= “10%,50%,40%”>
</frameset>
************************************************************************
*******
Session 2: 1.
Write an HTML code to develop a Web page having two frames that divide the Web
page into two equal rows.
Name Krishna Prabhu Enrolment No:
094545291
************************************************************************
*******
<html>
<head>
<title>Basic Frame Exercise</title>
</head>
<frameset rows="*,*">
<frame name="topFrame">
<frame name="bottomFrame">
</frameset>
</html>
************************************************************************
Session 2: 2.
Write an HTML code to develop a Web page having two frames that divide the Web
page into two equal rows and then divide the second row into two equal columns.
Name Sujana Y Enrolment No: 094545055
************************************************************************
<html>
<head>
<title>Advance Frame Exercise</title>
</head>
<frameset rows="*,*">
<frame name="topFrame">
<frameset cols="*,*">
<frame name="bottomFrameA">
<frame name="bottomFrameV">
</frameset>
</frameset>
</html>
************************************************************************
Session 2: 3.
Write an HTML code to develop a Web page having frames as described in the
above question and then fill each frame with a different background color.
Name Krishna Prabhu Enrolment No: 094545055
************************************************************************
<html>
<head>
<title>Advance Frame Exercise</title>
</head>
<frameset rows="*,*">
<frame name="topFrame" src="top.htm">
<frameset cols="*,*">
<frame name="bottomFrameA" src="bottomleft.htm">
<frame name="bottomFrameV" src="bottomRight.htm">
</frameset>
</frameset>
</html>
************************************************************************
*******
Write the code to develop a web page as shown below using frames.
<HTML>
<head>
<title>Frames Example</title>
</head>
<frameset cols="*,2*">
<frame src=1.html>
<frameset rows="50%,50%">
<frame src=2.html>
<frameset cols="*,2*">
<frame src=3.html>
<frame src=3.html>
</frameset>
</frameset>
</frameset>
</html>
************************************************************************
Design a page with a text box called name and a button with label Enter. When you
click on the button another page should open with the message “Welcome <name>”,
where name should be equal to the name entered in the first page.
<html>
<head>
</head>
<script Language=VBScript>
Sub btnEnter_OnClick()
document.write" WELCOME "&frm.txtName.Value&"<br>"
End Sub
</script>
<form name="frm">
<table><tr>
<td><h4>Enter your Name</h4></td><td><input type=text Name=txtName
size="27"></td>
</tr></table>
<input type="submit" value="Enter" Name="btnEnter" />
</form>
</body>
************************************************************************
‘Design a page, which is like ‘compose’ page of e-mail’
<html>
<head>
</head>
<body>
<form>
<table cellspacing="10">
<tr>
<td>To</td>
<td><input type=text Name=txtState size="40"></td>
</tr>
<tr>
<td>Cpoy</td>
<td><input type=text Name=txtState size="40"></td>
</tr>
<tr>
<td>Message</td>
<td></td>
</tr>
<tr>
<td></td>
<td rowspan=3><Textarea cols=35 rows=9></textarea></td>
</tr>
<table>
<input type=button Name=btnSend value="Send" size="40">
</form>
</body>
************************************************************************
Program No:1
Create a form in HTML containing the following fields and then perform the
validation of each field using vb script.
<html>
<head>
<title>Validate</title>
</head>
<script Language=VBScript>
function addcheck()
msgbox"Please check your email details are correct before submitting"
end function
Sub btnSubmit_OnClick()
name=frm.txtName.value
count=len(name)
for i=1 to count
var=mid(name,i,1)
if isnumeric(var)=true then
Msgbox "Name schould be charector"
Exit sub
frm.txtName.value=""
frm.txtName.focus
Exit for
end if
next
no=frm.txtPhone.value
count=len(no)
for i=1 to count
var=mid(No,i,1)
if isnumeric(var)<>true then
Msgbox "Enter only numeric digits"
Exit sub
frm.txtPhone.value=""
frm.txtPhone.focus
Exit for
end if
next
if name = frm.txtName.value="" or frm.txtAddress.value="" or frm.txtphone.value="" or
frm.txtemail.value="" Then
MSGBOx "Enter All the fields."
Exit Sub
else
name =frm.txtName.value
add = frm.txtAddress.value
phone=frm.txtphone.value
email=frm.txtemail.value
v=frm.date.value & "/" & frm.month.value & "/" & frm.year.value
document.write"Your Details"&"<br>"
document.write"<Table>"
document.write"<tr>"
document.write"<td>"
document.write"Name"
document.write"</td>"
document.write"<td>"
document.write name
document.write"</td>"
document.write"</tr>"
document.write"<tr>"
document.write"<td>"
document.write"Address"
document.write"</td>"
document.write"<td>"
document.write add
document.write"</td>"
document.write"</tr>"
document.write"<tr>"
document.write"<td>"
document.write"Phone"
document.write"</td>"
document.write"<td>"
document.write phone
document.write"</td>"
document.write"</tr>"
document.write"<tr>"
document.write"<td>"
document.write"Email"
document.write"</td>"
document.write"<td>"
document.write email
document.write"</td>"
document.write"</tr>"
document.write"<tr>"
document.write"<td>"
document.write"Date"
document.write"</td>"
document.write"<td>"
document.write v
document.write"</td>"
document.write"</tr>"
document.write"</table>"
end if
End Sub
</script>
<body>
<form Name="frm">
<table cellpadding="4" border="2">
<tr>
<td width="137" height="25" align="right">Name</td>
<td width="230" height="25"><input type=text Name=txtName width="20"
size="27"></td></tr>
<tr>
<td width="137" height="76" align="right">Address</td>
<td width="230" height="76"><Textarea width="20" rows="3" cols="21"
Name=txtAddress></textarea></td></tr>
<tr>
<td width="137" height="25" align="right">Phone</td>
<td width="230" height="25"><input type=text Name=txtPhone size="27"></td>
</tr>
<tr>
<td width="137" height="25" align="right">email</td>
<td width="230" height="25"><input type=text Name=txtEmail size="27"
onBlur=addCheck()></td>
</tr>
<tr>
<td width="137" height="48" align="right">Date of Birth</td>
<td width="230" height="48">
<select Name="date">
<option Selected>date</option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="04">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select Name="month" >
<option selected>month</option>
<option value="01">01</option>
<option value="02">02</option>
<option value="03">03</option>
<option value="04">04</option>
<option value="05">05</option>
<option value="06">06</option>
<option value="07">07</option>
<option value="08">08</option>
<option value="04">09</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
<select Name="year">
<option Selected>year</option>
<option value="2009">2009</option>
<option value="2008">2008</option>
<option value="2007">2007</option>
<option value="2006">2006</option>
<option value="2005">2005</option>
<option value="2004">2004</option>
<option value="2003">2003</option>
<option value="2002">2002</option>
<option value="2001">2001</option>
<option value="2000">2000</option>
<option value="1999">1999</option>
<option value="1998">1998</option>
<option value="1997">1997</option>
<option value="1996">1996</option>
<option value="1995">1995</option>
<option value="1994">1994</option>
<option value="1993">1993</option>
<option value="1992">1992</option>
<option value="1991">1991</option>
<option value="1990">1990</option>
<option value="1989">1989</option>
<option value="1988">1988</option>
<option value="1987">1987</option>
<option value="1986">1986</option>
<option value="1985">1985</option>
<option value="1984">1984</option>
<option value="1983">1983</option>
<option value="1982">1982</option>
<option value="1981">1981</option>
<option value="1980">1980</option>
<option value="1979">1979</option>
<option value="1976">1976</option>
<option value="1977">1977</option>
<option value="1978">1978</option>
<option value="1975">1975</option>
<option value="1974">1974</option>
<option value="1973">1973</option>
<option value="1972">1972</option>
<option value="1971">1971</option>
<option value="1970">1970</option>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Register" Name="btnSubmit" />
</td><td</td></tr>
</table>
</form>
</body>
</html>
************************************************************************
*******
Program No:2
Using an HTML form accept the principle rate of interest and time from the user,
validate the three fields and the display the simple interest to the user.
<html>
<head>
<title>Simple Intrest</title>
</head>
<script Language=VBScript>
Sub btnCal_OnClick()
P=frm.txtP.value
count=len(P)
for i=1 to count
var=mid(P,i,1)
if isnumeric(var)<>true then
Msgbox "Enter only numeric digits"
Exit sub
frm.txtP.value=""
frm.txtP.focus
Exit for
end if
next
R=frm.txtR.value
count=len(R)
for i=1 to count
var=mid(R,i,1)
if isnumeric(var)<>true then
Msgbox "Enter only numeric digits"
Exit sub
frm.txtR.value=""
frm.txtR.focus
Exit for
end if
next
T=frm.txtT.value
count=len(T)
for i=1 to count
var=mid(T,i,1)
if isnumeric(var)<>true then
Msgbox "Enter only numeric digits"
Exit sub
frm.txtT.value=""
frm.txtT.focus
Exit for
end if
next
ans=(P*T*R)/100
frm.txtI.value=ans
End Sub
</script>
<body>
<form Name="frm">
<Center><lable><h3>Calculating the simple intrest</h3></lable>
<table cellpadding="4" border="2">
<tr>
<td width="137" height="25" align="right">Principle AMount</td>
<td width="230" height="25"><input type=text Name=txtP width="20"
size="27"></td></tr>
<tr>
<td width="137" height="25" align="right">Rate of Intrest</td>
<td width="230" height="25"><input type=text Name=txtR size="27"></td>
</tr>
<tr>
<td width="137" height="25" align="right">Time</td>
<td width="230" height="25"><input type=text Name=txtT size="27"></td>
</tr>
<tr>
<td width="137" height="48" align="right">Simple Intrest</td>
<td width="230" height="48">
<input type=text Name=txtI size="27"></td>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="Calculate" Name="btnCal" />
</td><td</td></tr>
</table>
</center>
</form>
</body>
************************************************************************
Program No:3
Using the do while loop display the factorial of a number.
<html>
<head>
<title>Factorail</title>
</head>
<script Language=VBScript>
Sub btnCal_OnClick()
if frm.txtF.value="" Then
MSGBOx "Please enter a number."
Exit Sub
end if
f=frm.txtF.value
count=len(f)
for i=1 to count
var=mid(f,i,1)
if isnumeric(var)<>true then
Msgbox "Please enter a number"
Exit sub
frm.txtP.value=""
frm.txtP.focus
Exit for
end if
next
eg=Int(f)
i=1
fact=1
Do While i<=eg
fact=fact*i
i=i+1
Loop
frm.txtAns.value=fact
End Sub
</script>
<body>
<form Name="frm">
<Center><lable><h3>Finding the factorial of given number</h3></lable>
<table cellpadding="4" border="2">
<tr>
<td width="137" height="25" align="right">Enter a number</td>
<td width="230" height="25"><input type=text Name=txtF width="20"
size="27"></td></tr>
<tr>
<td width="137" height="25" align="right">Rate of Intrest</td>
<td width="230" height="25"><input type=text Name=txtAns size="27"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="Factorial" Name="btnCal" />
</td><td</td></tr>
</table>
</center>
</form>
</body>
************************************************************************
Program No:4
Design a form using all input types
<html>
<head>
</head>
<center>
<lable><h3> Input Types of Form</h3></lable>
<table cellpadding="4" width="422" border="2">
<tr>
<td width="86" height="25" align="left">Name</td>
<td width="310" height="25"><input type="text" Name="txtName" width="20"
size="27"></td>
</tr>
<tr>
<td width="86" height="76" align="left">Address</td>
<td width="310" height="76"><textarea width="20" rows="3" cols="21"
Name="txtAddress"></textarea></td>
</tr>
<tr>
<td width="86" height="25" align="left">Password</td>
<td width="310" height="25"><input type="password" Name="txtpw"
size="27"></td>
</tr>
<tr>
<td width="86" height="25" align="left">Country</td>
<td width="310" height="25"><select Name="cmbCountry">
<option value="Australia">Australia</option>
<option value="Austria">Austria</option>
<option value="Bahrain">Bahrain</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Brazil">Brazil</option>
<option value="Canada>Canada</option>
<option value=" China">China, Peoples Republic of</option>
<option value="Denmark">Denmark</option>
<option value="England">England</option>
<option value="Finland">Finland</option>
<option value="France">France</option>
<option value="Germany">Germany</option>
<option value="Greece">Greece</option>
<option value="Hong Kong">Hong Kong</option>
<option value="India">India</option>
<option value="Malaysia">Malaysia</option>
<option value="Mexico">Mexico</option>
<option value="New Zealand">New Zealand</option>
<option value="South Africa">South Africa</option>
<option value="Switzerland">Switzerland</option>
<option value="United Kingdom">United Kingdom</option>
<option value="United States">United States</option>
</select></td>
</tr>
<tr>
<td width="86" height="21" align="left">Sex</td>
<td width="310" height="21">Male<input type="radio" name="rbMale"
value="Male">
Female<input type="radio" name="rbFemale" value="FeMale"></td>
</tr>
<tr>
<td width="86" height="48" align="left">Hobies</td>
<td width="310" height="48">Cricket<input type="checkbox" value="ON">
Music<input type="checkbox" </td value="ON">
</tr>
<tr>
<td width="86" height="48" align="left">Submit Button</td>
<td width="310" height="48"><input type="submit" value="Submit"
Name="btnRegisiter" />
</tr>
<tr>
<td width="86" height="48" align="left">Reset Button</td>
<td width="310" height="48"><input type="reset" value="Clear" />
</tr>
</table>
</center></form>
</body>
</html>
************************************************************************
Program No: 1
Embed Java script in html document asking user’s name and then printing Hello
<User Name>.
<html>
<head>
<script language="javascript">
function fn(x)
{
for(i=1;i<=10;i++)
{
alert("HI"+i);
document.write(parseInt(x.value)*i+"<BR>");
}
}
</script>
</head>
<body>
<form>
<input type="text" name="no">
<input type="submit" value="GetTable" Name="B" OnClick=fn(no)>
</form>
</body>
</html>
************************************************************************
Program No:3
Designing a web page to create a pull down menu box.
<html>
<head>
<script language="JavaScript" type="text/javascript">
<!--
function go(){
if(document.selecter.select1.options[document.selecter.select1.selectedIndex].value!
="none")
{
location=document.selecter.select1.options[document.selecter.select1.selectedIndex].valu
e
}
}
//->
</script>
</head>
<body>
<script language="JavaScript" type="text/javascript">
<!--
function randomBg(){
var hex1=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F")
var hex2=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F")
var hex3=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F")
var hex4=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F")
var hex5=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F")
var hex6=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F")
var bg="#"+hex1[Math.floor(Math.random()*hex1.length)]
+hex2[Math.floor(Math.random()*hex2.length)]
+hex3[Math.floor(Math.random()*hex3.length)]
+hex4[Math.floor(Math.random()*hex4.length)]
+hex5[Math.floor(Math.random()*hex5.length)]
+hex6[Math.floor(Math.random()*hex6.length)]
return bg;
}
</script>
<html>
<body>
Hello
<script language="JavaScript">
setInterval("chcolor()",1000);
</script>
</body>
</html>