Professional Documents
Culture Documents
DEPARTMENT
Of
NAME : JAYASHREE.R
REGISTER NO : 193181101012
5 23-09-2021 TABLE
7 30-09-2021 FORMS
8 01-10-2021 CSS
193181101012 1 JAYASHREE.R
WEB PAGE CREATION
AIM:
To write a html code to develop a web page having the background in red and title “My
FirstPage” apply marquee in any other color, giving details of your name, age, address.
ALGORITHM:
STEP 1: Start the html program by opening HTML tag <html>.
STEP 2: Open the head and title tag to give their contents and close them
STEP 3: Open the body tag and give “My first page” as a text to be displayed.
STEP 4: Open marquee tag. Inside marquee, give font-family, font-size, color, width, height,
direction, behaviour, scroll delay, scroll amount, loop, bg color, hspace, vspace, tex tcolor as its
style.
193181101012 2 JAYASHREE.R
PROGRAM:
<!DOCTYPE html>
<html>
</head>
<body style=background-color:red></body>
name=Jayashree<br>
age=21<br>
address=chennai;
</marquee>
</body>
</html>
193181101012 3 JAYASHREE.R
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3: The head tag has been opened. the head tag contain specific information about the web
page
LINE4: the title tag allows you to give a web page a title.
LINE 6: The body tag has been opened. The background color has been given has red.
LINE7: The h1 tag has been opened and closed. Here the heading for the web page has been
given.
LINE9:The marquee tag has been given .here the width, direction and height has been set
LINE10:The content has been given and break tag is given to break the line.
LINE11:The content has been given and break tag is given to break the line.
LINE12:The content has been given and break tag is given to break the line.
193181101012 4 JAYASHREE.R
OUTPUT:
RESULT:
Thus the html program with the background color red, and title “my first page” with
marquee in any other color, giving details of your name, age, address has been verified and
executed successfully.
193181101012 5 JAYASHREE.R
EXP NO: 2 DATE:16-09-2021
AIM:
To Create a web page to display list of names using ordered & unordered list.
ALGORITHM:
STEP 2: Open Ordered list tag and give the list with list tag and close the ordered list tag.
STEP 3: Open unordered list tag and give the list tag and close the unordered list tag
STEP 4: Close the program with HTML tag and save the file with .html extension.
193181101012 6 JAYASHREE.R
PROGRAM:
<!DOCTYPE html>
<html>
</head>
<body style=background-color:red>
<ol start="1"></ol><ol>fruits</ol>
<li>banana</li>
<li>apple</li>
<li>strawberry</li>
</body>
<body>
<ul start></ul><ul>vegetables</ul>
<li>tomato</li>
<li>carrot</li>
<li>chilly</li>
</body>
</html>
193181101012 7 JAYASHREE.R
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3: The head tag has been opened. the head tag contain specific information about the web
page
LINE4: the title tag allows you to give a web page a title.
LINE7: The h1 tage has been opened and closed. the heading for the web page has been given.
LINE9:The list tag has been given , the content has been given .
LINE10:The list tag has been given , the content has been given .
LINE11:The list tag has been given , the content has been given .
LINE12:The list tag has been given , the content has been given .
LINE16:The list tag has been given , the content has been given .
LINE17:The list tag has been given , the content has been given .
LINE18:The list tag has been given , the content has been given .
LINE19:The list tag has been given , the content has been given .
193181101012 8 JAYASHREE.R
OUTPUT:
RESULT:
Thus the web page to display list of names using ordered and unordered list has been
verified and executed successfully.
193181101012 9 JAYASHREE.R
EXP NO: 3 DATE:17-09-2021
AIM:
To create a web page that contains a image at its left hand side of the page when the user
clicks the image it should open on another web page.
ALGORITHUM:
STEP 1: Start the html code. Open html and head tags. Give their contents.
STEP 2: Open the body tag. Open <a> tag and give link using href.
193181101012 10 JAYASHREE.R
PROGRAM :
<!DOCTYPE html>
<html>
<title>image as hyperlink</title>
<h1>image as hyperlink</h1>
</head>
<body>
<a
href="https://www.onlinegdb.com/online_java_compiler"target="_self"</a>
<img src=https://www.google.com/url?sa=i&url=https%3A%2F
%2Fiso.500px.com%2Fthe-top-20-nature-photos-on-500px-so-far-this-year
%2F&psig=AOvVaw1kTZUCkE7iprDRntxdiIwl&ust=1632202087865000&s
ource=images&cd=vfe&ved=0CAgQjRxqFwoTCKCAyOLojPMCFQAAAAA
dAAAAABAD /img>
</body>
</html>
193181101012 11 JAYASHREE.R
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3: The head tag has been opened. the head tag contain specific information about the web
page
LINE4: The h1 tage has been opened and closed. Here the heading for the web page has been
given.
LINE7:The a href tag has been given. It is a code to create a link to another page.
LINE8:The img src tag is given. The tag takes the image from the computer by giving location.
193181101012 12 JAYASHREE.R
OUTPUT:
193181101012 13 JAYASHREE.R
RESULT:
Thus the html page that contains image at its left hand side of the page when user clicks the
image it should open on another web page has been verified and executed successfully
193181101012 14 JAYASHREE.R
EXP NO: 4 DATE:17-09-2021
AIM:
To write a html code to create a floating image with paragraph tags
ALGORITHM:
STEP 2: Open <h1> tag and give the information and close <h1>.
STEP 4: Open <imgsrc>tag and give the image and align it in left side and close </p> tag.
STEP 5: Repeat step 3 and 4 by aligning the next image in lest side and close the respective tags.
193181101012 15 JAYASHREE.R
PROGRAM:
<!DOCTYPE html>
<html>
<title>program 4</title>
</head>
<body>
</body>
</html>
193181101012 16 JAYASHREE.R
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3: The head tag has been opened. the head tag contain specific information about the web
page
LINE4: The h1 tag has been opened and closed. Here the heading for the web page has been
given.
LINE7:The img src tag has given along with border ,height and the picture has been aligned to
left
LINE8:The paragraph tag has given to enter the content inside the program.
LINE9:The img src tag is given. along with border ,height and the picture has been aligned to
right.
LINE10:The paragraph tag has given to enter the content inside the program.
193181101012 17 JAYASHREE.R
OUTPUT:
193181101012 18 JAYASHREE.R
RESULT:
Thus the html code to create a floating image with paragraph tags has been verified and
executed successfully
193181101012 19 JAYASHREE.R
EXP NO: 5 DATE:23-09-2021
TABLE
AIM:
Create a web page to display a table and fill the data in the table created
ALGORITHM:
STEP 3: Open the table-row tag and define bgcolor and alignment. Open the table data tag and
give data items.
193181101012 20 JAYASHREE.R
PROGRAM:
<!DOCTYPE html>
<html>
<title>program 5</title>
</head>
<body>
<br><br><br>
<tr>
<th colspan="5">
<h1>Details</h1>
</th>
<tr>
<th style="background-color:green">name</th>
<th style="background-color:blue">designation</th>
<th style="background-color:yellow">college</th>
</tr>
<tr>
<td>priyanka</td>
<td>assistant professor</td>
<td>kcg</td>
</tr>
<tr>
<td>praveen</td>
193181101012 21 JAYASHREE.R
<td>assistant professor</td>
<td>drmgr</td>
</tr>
<tr>
<td>arun</td>
<td>assistant professor</td>
<td>ade</td>
</tr>
<tr>
<td>dineshkumar</td>
<td>assistant professor</td>
<td>srm</td>
</tr>
<tr>
<td>saravanan</td>
<td>assistant professor</td>
<td>all</td>
</body>
</html>
193181101012 22 JAYASHREE.R
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3:The table has been created with border ,width ,cellpadding(specify the amount of space
between the border of a table cell and its content) ,cellspacing(to specify space between the cells)
,background color ,alignment to center and vertical alignment to middle.
LINE5:The table header tag and colspan given( colspan attribute defines the number of columns
a table cell should span).
LINE9:The table header is opened, the background color has been given and also the content in
side the cell is given. Then table header tag is closed.
LINE10:The table header is opened, the background color has been given and also the content in
side the cell is given. Then table header tag is closed.
LINE11:The table header is opened, the background color has been given and also the content in
side the cell is given. Then table header tag is closed.
LINE12:The table header is opened, the background color has been given and also the content in
side the cell is gSiven. Then table header tag is closed.
LINE13:The table header is opened, the background color has been given and also the content in
side the cell is given. Then table header tag is closed.
LINE14:The table header is opened, the background color has been given and also the content in
side the cell is given. Then table header tag is closed.
LINE15:The table header is opened, the background color has been given and also the content in
side the cell is given. Then table header tag is closed.
LINE16:The table header is opened, the background color has been given and also the content in
side the cell is given. Then table header tag is closed.
193181101012 23 JAYASHREE.R
LINE17:The table header is opened, the background color has been given and also the content in
side the cell is given. Then table header tag is closed.
LINE18:The table header is opened, the background color has been given and also the content in
side the cell is given. Then table header tag is closed.
LINE20:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE21:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE22:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE23:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE24:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE25:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE26:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE27:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE28:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE29:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE32 :The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE33:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
193181101012 24 JAYASHREE.R
LINE34 :The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE35 :The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE36 :The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE37 :The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE38 :The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE39 :The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE40 :The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE41 :The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE44:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE45:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE46:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE47:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE48:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE49:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
193181101012 25 JAYASHREE.R
LINE50:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE51:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE52:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE53:The td tag is opened .table data is given such has background color and the content
inside the cell ,then the tag is closed.
LINE 55:The paragraph tag is opened , the content has been given and the tag is closed.
193181101012 26 JAYASHREE.R
OUTPUT:
vv
RESULT:
Thus the web page to display a table and fill the data in the table has been verified and
executed successfully.
193181101012 27 JAYASHREE.R
EXP NO: 6 DATE :24-09-2021
AIM:
Create a web page having to frames one containing links and another with contents of the
link when link is clicked appropriate contents should be displayed on frame.
ALGORITHM:
STEP 3: Create a frame source for 2 frames. Give the link in page1 so that it is displayed in
frame 2 using <a href> tags.
193181101012 28 JAYASHREE.R
PROGRAM:
6.HTML
<!DOCTYPE.html>
<html>
<title>jayashree</title>
<frameset cols="20%,50%">
<frame src="2.html">
<frameset cols="30%,30%">
<frame src="3.html">
<frmeset cols="25%,25%">
<frame src="4.html">
<frameset cols="25%,25%">
<frame src="5.html">
</frame set>
</frame set>
</frame set>
</frame set>
</html>VV
193181101012 29 JAYASHREE.R
193181101012 30 JAYASHREE.R
6.1.HTML
<!DOCTYPE html>
<html>
<body>
<h1>KRP Solutions</h1>
<h2>about us</h2>
<p><a href=services></a></p>
<ol>
<li>Bread</li>
<br>
<li>Apple</li>
</ol>
</body>
</html>
193181101012 31 JAYASHREE.R
6.2.HTML
<!DOCTYPE html>
<html>
<body>
<p>ARAVIND>P<br>
019876543211<br>
abcdefgh<br>
</p>
<p>conatct info-*****</p>
</body>
</html>
193181101012 32 JAYASHREE.R
6.3.HTML
<!DOCTYPEhtml>
<html>
<body>
<h1>MGR UNIVERSITY</h1>
</p>
<p>contact info<br>
987654321<br>
</p>
</body>
</html>
193181101012 33 JAYASHREE.R
EXPLANATION:
6.HTML (explanation)
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3: The head tag has been opened. the head tag contain specific information about the web
page.
LINE4:The title tag is opened then the content is given and the tag is closed.
LINE5:Here frameset cols attribute is used to specify the size and the number of columns in a
frameset.
LINE6: Here the frame source tag is given and the scrolling function is given yes.
LINE9: Here frameset cols attribute is used to specify the size of the frame set.
LINE11:Here frameset cols attribute is used to specify the size of the frame set.
193181101012 34 JAYASHREE.R
6.1.HTML (explanation)
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE4:The header tag h1 is opened ,the content is given and the tag is closed
LINE5: The header tag h2 is opened ,the content is given and the tag is closed
LINE7:The a href tag(refers to specify the url page the link goes to) and the target is set to frame
one where the program should be placed, then the content is given and the tag is closed and the
paragraph tag is closed.
LINE8:The paragraph tag and a href tag is opened and the content is given then the tag is closed.
LINE9: The paragraph tag and a href tag is opened and the content is given then the tag is closed.
LINE10:The paragraph tag and a href tag is opened and the content is given then the tag is
closed.
LINE12:The list tag is given and he content is entered , then the tag is closed.
LINE14:The list tag is given and he content is entered , then the tag is closed.
LINE16:The list tag is given and he content is entered , then the tag is closed.
193181101012 35 JAYASHREE.R
6.2.HTML (explanation)
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE4:The header tag h1 is opened ,the content is given and the tag is closed
LINE5: The header tag h2 is opened ,the content is given and the tag is closed
LINE7:The a href tag(refers to specify the url page the link goes to) and the target is set to frame
one where the program should be placed, then the content is given and the tag is closed and the
paragraph tag is closed.
LINE8:The paragraph tag and a href tag is opened and the content is given then the tag is closed.
LINE9: The paragraph tag and a href tag is opened and the content is given then the tag is closed.
LINE10:The paragraph tag and a href tag is opened and the content is given then the tag is
closed.
LINE12:The list tag is given and he content is entered , then the tag is closed.
LINE14:The list tag is given and he content is entered , then the tag is closed.
LINE16:The list tag is given and he content is entered , then the tag is closed.
193181101012 36 JAYASHREE.R
6.3.HTML (explanation)
LINE1: the DOCTYPE decleration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE4:The header tag h1 is opened ,the content is given and the tag is closed
LINE5: The paragraph tag is opened, the content is entered and the break tag is given.
193181101012 37 JAYASHREE.R
OUTPUT:
RESULT:
Thus the web page having two frames containing one as link to its contents has been
executed successfully.
193181101012 38 JAYASHREE.R
EXP NO: 7 DATE:30-09-2021
FORMS
AIM:
ALGORITHM :
STEP 1: Open the html tag. Determine the styles of respective classes inside the body tag along
with their details.
STEP 2: Open form tag. Give details of form inside the for tag and their styles there itself.
193181101012 39 JAYASHREE.R
PROGRAM:
<!DOCTYPE html>
<html>
<title>Form</title>
</head>
<body>
<form action="https://docs.google.com/forms/u/0/d/e/1FAIpQLSdN8d0H4qhcGv2-
x55_V8nU3FDnXqbyyyRtXORjsG2upTdTuQ/formResponse" target="_self" method="POST"
<label>STUDENT NAME</label>
<label>REG NO</label>
<p><button type="submit">Submit</button></p>
</form>
</body>
</html>
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3: The head tag has been opened. the head tag contain specific information about the web
page
LINE4: the title tag allows you to give a web page a title.
193181101012 40 JAYASHREE.R
LINE5: Head tag has been closed .
LINE7: The form tag is opened . Here form action tag is used to define what should happen to
data when a form is submitted on a web page.
LINE8: The label tag is opened and closed(used to specify a label for an <input> element of a
form. Text is given inside the tag.
LINE9: Here input tag is given where user can enter data. Type is given for which type the data
will be enter example text ,place holder is a tag where the entered data should be registered.
LINE10: The label tag is opened and closed(used to specify a label for an <input> element of a
form. Text is given inside the tag
LINE11: Here input tag is given where user can enter data. Type is given for which type the data
will be enter example text ,place holder is a tag where the entered data should be registered.
LINE12:The paragraph tag is given to enter the data and tag is closed
LINE13:The h5 tag is given to display the heading and the tag is closed.
193181101012 41 JAYASHREE.R
OUTPUT:
RESULT:
Thus the program to create a simple form accepting Name, Reg. No, and submit button has been
executed successfully.
193181101012 42 JAYASHREE.R
EXP NO: 8 DATE:01-10-2021
CSS
AIM:
To write a simple style sheet using font-size property for text sizes.
ALGORITHM:
STEP 3: Use div.a, div.b and div.c and give the style px, em, %.
193181101012 43 JAYASHREE.R
193181101012 44 JAYASHREE.R
PROGRAM:
<!DOCTYPE.html>
<html>
<body>
div.a{
font-size:2.875em;
div.b{
font-size:100%;
div.c{font-size:70px;
</style>
</head>
<body>
</body>
</html>
193181101012 45 JAYASHREE.R
193181101012 46 JAYASHREE.R
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3: The head tag has been opened. the head tag contain specific information about the web
page
LINE4: The style tag is been opened .(contains the css and information for a document or a part
of a document)
LINE5: Division tag is given to make a division of content in the web page and has been named
as A.
LINE8: Division tag is given to make a division of content in the web page and has been named
as B.
LINE11:Division tag is given to make a division of content in the web page and has been named
as C.
LINE17: The h1 tag is given to display the content inside the tag.
193181101012 47 JAYASHREE.R
LINE21: The body tag has been closed.
LINE22: The h5 tag is given to display the content inside the tag.
193181101012 48 JAYASHREE.R
OUTPUT:
193181101012 49 JAYASHREE.R
RESULT:
Thus the simple style sheet using font-size property for text sizes has been verified and executed
successfully.
193181101012 50 JAYASHREE.R
EXP NO: 9 DATE:21-10-2021
AIM:
To create a style sheet to implement the class attribute and id to differentiate the text color
ALGORITHM:
STEP 1: Start the program with html tag.
STEP 4: Create a style using the <style> tag for each attribute.
193181101012 51 JAYASHREE.R
PROGRAM:
<!DOCTYPE.html>
<html>
<body>
<style>
#class{
background-color:#ff5733;
font-size:25px;
</style>
</head>
<body style="text-align:center">
</body>
</html>
193181101012 52 JAYASHREE.R
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3: The head tag has been opened. the head tag contain specific information about the web
page.
LINE4:The title tag is opened , the title is given and and the tag is closed.
LINE5: The style tag is been opened .(contains the css and information for a document or a part
of a document)
LINE6:# is given to make a division of content in the web page and has been named as aravind.
LINE13: The h1 tag is given to display the content inside the tag.
LINE14:The paragraph tag is given then id is given to take the content from #aravind. and the
content inside the paragraph tag is given then the tag is closed.
LINE15:The paragraph tag is given, the content is given and the tag is closed.
LINE16: The h5 tag is given to display the content inside the tag.
193181101012 53 JAYASHREE.R
OUTPUT:
193181101012 54 JAYASHREE.R
RESULT:
Thus the style sheet to implement the class attribute and id to differentiate the text color
has been executed successfully.
193181101012 55 JAYASHREE.R
EXP NO: 10 DATE:21-10-2021
AIM:
To write a program to compute Fibonacci sequence using java script.
ALGORITHM:
193181101012 56 JAYASHREE.R
PROGRAM:
<!DOCTYPE html>
<html>
<meta charset="utf-8">
</head>
<body>
<script>
var n1 = 0, n2 = 1, next_num, i;
var num = parseInt (prompt (" Enter the limit for Fibonacci Series "));
next_num = n1 + n2;
n1 = n2;
n2 = next_num;
</script>
</body>
</html>
193181101012 57 JAYASHREE.R
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3: The head tag has been opened. the head tag contain specific information about the web
page.
LINE4:This line use the utf-8 character encoding when translating machine code into human
readable text and vice versa to be displayed in the browser.
LINE5:The title tag is opened , the title is given and and the tag is closed.
LINE10:The variable number is given , parseInt function converts its first argument to a string
LINE20: The h5 tag is given to display the content inside the tag.
193181101012 58 JAYASHREE.R
OUTPUT:
RESULT:
Thus the Fibonacci series using java script program has been verified and executed successfully.
193181101012 59 JAYASHREE.R
EXP NO: 11 DATE:22-10-2021
AIM:
To write a simple java script program to copy text from different field.
ALGORITHM:
STEP 3: Create form in the body by which it has the checkbox input.
193181101012 60 JAYASHREE.R
PROGRAM:
<!DOCTYPE html>
<html>
<meta charset="utf-8">
</head>
<body>
<html>
<head>
<script>
function FillBilling(f) {
if(f.billingtoo.checked == true) {
f.billingname.value = f.shippingname.value;
f.billingcity.value = f.shippingcity.value;
</script>
</head>
<body>
<h2>Mailing Address</h2>
<form>
<p>Name:raji
193181101012 61 JAYASHREE.R
<input type="text" name="shippingname"></p>
<p>City:chennai
</p>
<em>Check this box if Billing Address and Mailing Address are the same.</em>
<P>
<h2>Billing Address</h2>
<p>
Name:raji
</p>
<p>City:chennai
</P>
</form>
</body>
</html>
</body>
</html>
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
193181101012 62 JAYASHREE.R
LINE3: The head tag has been opened. the head tag contain specific information about the web
page.
LINE4:This line use the utf-8 character encoding when translating machine code into human
readable text and vice versa to be displayed in the browser.
LINE5:The title tag is opened ,then title given and title tag is closed.
LINE12:Here is the user clicks the check box the following details will happen and the left
parentheses is opened.
LINE20:Header tag h2 is opened then the content is entered and the tag is closed.
LINE22: The paragraph tag is created & content is entered. Input type is given as text and
name id given as shipping name .then the tag is closed.
LINE23: : The paragraph tag is created & content is entered. Input type is given as text and
name id given as shipping city .then the tag is closed.
LINE24:Input type is given as checkbox, its designed as once the check box is clicked the details
filled in the above box will be pasted inside the blow box.
193181101012 63 JAYASHREE.R
LINE25:The em tag is opened(emphasized text) the content is entered and the tag is closed.
LINE26:The header tag is created and the content is entered and the tag is closed.
LINE27: : The paragraph tag is created & content is entered. Input type is given as text and
name id given as billing name .then the tag is closed.
LINE28: : The paragraph tag is created & content is entered. Input type is given as text and
name id given as billing city .then the tag is closed
LINE33:Header tag is given and the content is entered and the tag is closed.
193181101012 64 JAYASHREE.R
OUTPUT:
RESULT:
193181101012 65 JAYASHREE.R
Thus the simple java script program to copy text from different fields has been executed
successfully.
193181101012 66 JAYASHREE.R
EXP NO: 12 DATE:22-10-2021
AIM:
To write a program to check the given number is odd or even using java script.
ALGORITHM:
193181101012 67 JAYASHREE.R
PROGRAM:
<!doctype html>
<html><P>
<script>
function fun()
num = parseInt(document.getElementById("num").value);
if(num)
temp = document.getElementById("resPara");
temp.style.display = "block";
if(num%2==0)
document.getElementById("res").innerHTML = "Even";
else
document.getElementById("res").innerHTML = "Odd";
</script>
</head>
<body>
193181101012 68 JAYASHREE.R
<p>Enter the Number: <input id="num"><button
onclick="fun()">Check</button></p>
</body>
</html>
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2: The html tag has been opened ,the html tag is the root element of an HTML page.
LINE3: The head tag has been opened. the head tag contain specific information about the web
page
LINE4: title has been opened and the title is given and the tag is closed.
LINE7:content inside the body tag is given and input id is also given .
LINE8:Button is set and the content inside the button is given has “click me”
LINE12:Variable is no
193181101012 69 JAYASHREE.R
LINE15:left parentheses Is opened
193181101012 70 JAYASHREE.R
OUTPUT:
193181101012 71 JAYASHREE.R
VV
RESULT:
Thus the program to execute the given numbers is odd or even using java script has been
executed successfully
193181101012 72 JAYASHREE.R
EXP NO: 13 DATE:28-10-2021
SWITCH CASE-JAVASCRIPT
AIM:
To implement switch case to find the days of the week using java script
ALGORITHM:
STEP 1: Open and start the program using the html tag.
STEP 3: Give the input in which the number of the week is to be given.
STEP 4: Enter the scripting using the switch case. STEP 5: Give the default if not a valid input
is given.
193181101012 73 JAYASHREE.R
PROGRAM:
<html>
<script type=text/javascript>
function days(dayOfTheWeek)
switch (dayOfTheWeek)
case 1:
case 2:
case 3:
case 4:
case 5:
193181101012 74 JAYASHREE.R
alert("It’s Friday"); break;
case 6:
case 7:
default:
</script>
</html>
193181101012 75 JAYASHREE.R
EXPLANATION:
LINE1: The DOCTYPE declaration is an instruction to a web browser about what version of
HTML the page is written in,(HTML5 document).
LINE2:paragraph tag is opened , the content is entered and the tag is closed.
LINE3:Header tag is opened , the text is aligned to center , the content has been entered and the
tag is closed.
LINE11:if the user click the no1 then the condition executes
LINE13:if the user click the no2 then the condition executes
LINE15:if the user click the no3 then the condition executes
LINE17:if the user click the no4 then the condition executes
LINE19:if the user click the no5 then the condition executes
LINE21:if the user click the no6 then the condition executes
193181101012 76 JAYASHREE.R
LINE22:Alerts as “its saturday” will be displayed in the web page
LINE23:if the user click the no7 then the condition executes
LINE25:if the user clicks othe than the 7 digits then the condition executes
LINE26:Alerts as “Enter a valid day (1-7)” will be displayed in the web page
193181101012 77 JAYASHREE.R
OUTPUT:
193181101012 78 JAYASHREE.R
RESULT:
Thus the program to implement switch case to find the days of the week using java script
has beeSn executed successfully.S
193181101012 79 JAYASHREE.R