Vasavi College of Engineering
Vasavi College of Engineering
Vasavi College of Engineering
(AUTONOMOUS)
(AFFLIATED TO OSMANIA UNIVERSITY)
Hyderabad - 500031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF LAB0RATORY : Web Technologies Lab
Name :Hema Kamani Roll No:1602-18-737-071 Page No:
AIM: Create HTML Document using basic Tags like <h1> to <h6>
TAGS USED:
<!DOCTYPE html> - It is an "information" to the browser about what document type to expect.
<head> element is a container for metadata (data about data) and is placed between the
<html> tag and the <body> tag.
<body> element contains all the contents of an HTML document, such as headings,
paragraphs, images, hyperlinks, tables, lists, etc.
Program:
<html>
<head>
<title>header </title></head>
<body>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
</body>
</html>
VASAVI COLLEGE OF ENGINEERING
(AUTONOMOUS)
(AFFLIATED TO OSMANIA UNIVERSITY)
Hyderabad - 500031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF LAB0RATORY : Web Technologies Lab
Name :Hema Kamani Roll No:1602-18-737-071 Page No:
Output:
Result:To create HTML Document using basic Tags like <h1> to <h6> was completed successfully.
VASAVI COLLEGE OF ENGINEERING
(AUTONOMOUS)
(AFFLIATED TO OSMANIA UNIVERSITY)
Hyderabad - 500031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF LAB0RATORY : Web Technologies Lab
Name :Hema Kamani Roll No:1602-18-737-071 Page No:
AIM: Create HTML document using paragraph tag and line break tag.
TAGS USED:
<p> - Tag used for writing paragraphs
<br>- Tag used to insert a line break
Program:
<html>
<head>
<title>Paragraph and line break </title></head>
<body>
<p>Here is a first paragraph of text</p>
<p>Here is a second paragraph of text</p>
<p>Here is a third paragraph of text</p>
<p>Vasavi College of Engineering,Department of IT WEB Technologies Lab</p>
<p>Vasavi College of Engineering,<br>Department of IT<br> WEB Technologies Lab</p>
<br>
<h3 style="text-align: center">B.E. 3/4 IT Section-B</h3>
</body>
</html>
Output:
Result: Html document to be created using tags paragraph and line break is created successfully.
VASAVI COLLEGE OF ENGINEERING
(AUTONOMOUS)
(AFFLIATED TO OSMANIA UNIVERSITY)
Hyderabad - 500031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF LAB0RATORY : Web Technologies Lab
Name :Hema Kamani Roll No:1602-18-737-071 Page No:
Program:
<html>
<head>
<title>Subjects </title></head>
<body>
<ol type="I" >
<li style="font-size: 20px; font-weight: bold" >Semester Subjects </li>
<ol>
<li> Programming solving in C</li>
<li>Physics-I</li>
<li>Chemistry-I</li>
</ol>
Output:
RESULT:
Html document to create menu using ordered list is completed successfully.
VASAVI COLLEGE OF ENGINEERING
(AUTONOMOUS)
(AFFLIATED TO OSMANIA UNIVERSITY)
Hyderabad - 500031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF LAB0RATORY : Web Technologies Lab
Name :Hema Kamani Roll No:1602-18-737-071 Page No:
Q-4:
AIM:Create HTML document using ordered lists and other options.
TAGS USED:
<ul> - Tag to create a unordered list
<li> - Tag used to create a list item.
HTML CODE:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h3>List of It Labs</h3>
<ul>
<li>IT LAB-I</li>
<li>IT LAB-II</li>
<li>IT LAB-III</li>
<li>IT LAB-IV</li>
</ul>
<br>
</body>
</html>
VASAVI COLLEGE OF ENGINEERING
(AUTONOMOUS)
(AFFLIATED TO OSMANIA UNIVERSITY)
Hyderabad - 500031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF LAB0RATORY : Web Technologies Lab
Name :Hema Kamani Roll No:1602-18-737-071 Page No:
OUTPUT:
Result:
Html document to use ordered list and other options is completed successfully
VASAVI COLLEGE OF ENGINEERING
(AUTONOMOUS)
(AFFLIATED TO OSMANIA UNIVERSITY)
Hyderabad - 500031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF LAB0RATORY : Web Technologies Lab
Name :Hema Kamani Roll No:1602-18-737-071 Page No:
9 Pre-Lab Questions:
Ans: The <!-- --> is an HTML comment tag. To comment out in HTML, we insert information between
<!--
and --> tags (browsers won't show these notes).
3. What if there is no text between the tags or if a text was omitted by mistake? Will it affect the
display of html
file?
Ans: No it will not affect the display. If there is no text between the tags, then there is nothing to
format.
Therefore no formatting will appear. Only the text will be empty in the html file.
4. Mention what are the main language or platform used for web-design?
Ans: The following are the main languages or platforms used for web designing:
• HTML which stands for Hypertext Markup Language that helps design the base template.
• CSS which stands for Cascading Style Sheets is used for styling the pages.
• JS which is JavaScript is used to code the functionality.
• PHP or Personal Home Page which is used for server-side scripting
6.How do you create multi-coloured text in a webpage? Ans: Using css we can create multi
coloured text.
What is a marquee?
Ans: Marquee is one of the important tags introduced in HTML to support such scrollable texts and
images within a web page.
7.Are <br /> tags the only way to separate sections of text?
Ans: NO, we can also use <p> tag or <blockquote> tag to separate text.
9.How do you make a picture into a background image of a web page? Ans: <body
background="image.jpg">
What are some of the common lists that can be used when designing a page? Ans: ordered list and
unordered list
Ans: by using the type tag and assigning it the number type.
11.Identify some of the common lists that can be used when designing a page?
Ans: ordered list and unordered list
start: mention the starting number , reversed: reverse the numbers of list .
VASAVI COLLEGE OF ENGINEERING
AUTONOMOUS)
(Affiliated to Osmania University)
Hyderabad-500031
DEPARTMENT OF: _Information Technology__
NAME OF THE LABORATORY: _ Web Technologies Lab___
Name: Hema Kamani Roll No.: 1602-18-737-071 week : 2
1.Aim: Creation of a web page using table tags and their attributes
Tags used:
<table> defines a HTML table
<th> defines a header cell in a HTML table
<td> defines a standard data cell in a HTML table
<tr> defines a row in a HTML table
Program:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
HTML Tables
</title>
</head>
<body>
<h1 style="text-align: center;">Student Marks</h1>
<table style="margin-top: -25px; border: 3px solid yellow;background-color: pink; border-spacing: 10px; width:
95%">
<th style = "border: 1px solid yellow;height: 70px;">
Subject Name</th>
<th style = "border: 1px solid yellow;height: 70px;">Student Name</th>
<th style = "border: 1px solid yellow;height: 70px;">Roll No</th>
<th style = "border: 1px solid yellow;height: 70px;">Marks</th>
<tr>
<td rowspan="2",style="border:1px solid yellow; height:70px;padding:20px">WT</td>
<td style="border: 1px solid yellow; height: 70px; padding: 20px;">
Ramesh</td>
1
VASAVI COLLEGE OF ENGINEERING
AUTONOMOUS)
(Affiliated to Osmania University)
Hyderabad-500031
DEPARTMENT OF: _Information Technology__
NAME OF THE LABORATORY: _ Web Technologies Lab___
Name: Hema Kamani Roll No.: 1602-18-737-071 week : 2
</tr>
</table></body></html>
OUTPUT:
Result: program to create a web page using table tags and their attributes is successfully executed
2
VASAVI COLLEGE OF ENGINEERING
AUTONOMOUS)
(Affiliated to Osmania University)
Hyderabad-500031
DEPARTMENT OF: _Information Technology__
NAME OF THE LABORATORY: _ Web Technologies Lab___
Name: Hema Kamani Roll No.: 1602-18-737-071 week : 2
(Main frame.html)
<!DOCTYPE html>
<html>
<head>
<title>Frames</title>
</head>
<frameset rows="20%,80%">
<frame src="top.html">
<frameset cols="15%, 75%, 20%">
<frame src="left.html">
<frame src="center.html">
<frame src="right.html">
</frameset>
</frameset>
<body>
</body>
</html>
Top.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
Frame 1
</title>
</head>
<body style="background-color: darkgreen">
<h2>Top Frame</h2>
</body>
</html>
Left.html:
3
VASAVI COLLEGE OF ENGINEERING
AUTONOMOUS)
(Affiliated to Osmania University)
Hyderabad-500031
DEPARTMENT OF: _Information Technology__
NAME OF THE LABORATORY: _ Web Technologies Lab___
Name: Hema Kamani Roll No.: 1602-18-737-071 week : 2
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
Frame 1
</title>
</head>
<body style="background-color: firebrick">
<h2>Left Frame</h2>
</body>
</html>
Center.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
Frame 1
</title>
</head>
<body style="background-color: yellow">
<h2>Center Frame</h2>
</body>
</html>
Right.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
Frame 1
</title>
</head>
4
VASAVI COLLEGE OF ENGINEERING
AUTONOMOUS)
(Affiliated to Osmania University)
Hyderabad-500031
DEPARTMENT OF: _Information Technology__
NAME OF THE LABORATORY: _ Web Technologies Lab___
Name: Hema Kamani Roll No.: 1602-18-737-071 week : 2
OUTPUT:
5
VASAVI COLLEGE OF ENGINEERING
AUTONOMOUS)
(Affiliated to Osmania University)
Hyderabad-500031
DEPARTMENT OF: _Information Technology__
NAME OF THE LABORATORY: _ Web Technologies Lab___
Name: Hema Kamani Roll No.: 1602-18-737-071 week : 2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>
Excercise iframes</title>
</head>
<body>
<iframe src="lab1_2.html" height="200" width="400" title="Iframe Experiment"></iframe>
<br>
<iframe name="Iframe hyperlink" height="200" width="800"></iframe>
<a style="display: block" href="https://www.wikipedia.org" target="Iframe hyperlink">link</a>
<iframe width="860" height="315" src="https://www.youtube.com/embed/1Rs2ND1ryYc" title="Iframe
Youtube Player" frameborder="0"
allowfullscreen></iframe>
</body>
</html>
6
VASAVI COLLEGE OF ENGINEERING
AUTONOMOUS)
(Affiliated to Osmania University)
Hyderabad-500031
DEPARTMENT OF: _Information Technology__
NAME OF THE LABORATORY: _ Web Technologies Lab___
Name: Hema Kamani Roll No.: 1602-18-737-071 week : 2
OUTPUT:
7
VASAVI COLLEGE OF ENGINEERING
AUTONOMOUS)
(Affiliated to Osmania University)
Hyderabad-500031
DEPARTMENT OF: _Information Technology__
NAME OF THE LABORATORY: _ Web Technologies Lab___
Name: Hema Kamani Roll No.: 1602-18-737-071 week : 2
PRE-LAB QUESTIONS
1)How do you create frames?
To use frames on a page we use <frameset> tag instead of <body> tag.
The <frameset> tag defines how to divide the window into frames.
The<frameset rows:””> tag defines horizontal frames and <frameset cols:””> defines vertical
frames.
8
VASAVI COLLEGE OF ENGINEERING
AUTONOMOUS)
(Affiliated to Osmania University)
Hyderabad-500031
DEPARTMENT OF: _Information Technology__
NAME OF THE LABORATORY: _ Web Technologies Lab___
Name: Hema Kamani Roll No.: 1602-18-737-071 week : 2
10. Which attribute of <frameset> tag is used to divide the page into horizontal frames?
The <frameset> tag defines how to divide the window into frames. The rows attribute of
<frameset> tag defines horizontal frames and cols attribute defines vertical frames.
9
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _1 .
LAB-3
Program:
Portfolio Main.html
<!-- Hema Kamani
1602-18-737-071-->
<html>
<head>
<title>737-071/Portfolio</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="portfolio.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<h2>Hema <br><br></h2>
<h5>VI semester Information technology student<br></h5>
<ul class="toplinks">
<li><a href="">HOME</a></li>
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _2 .
</html>
Details.html
<!-- Hema Kamani
1602-18-737-071-->
<html>
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _3 .
<head>
<title>Details</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-
awesome.min.css">
<style>
body {
overflow: hidden;
}
.fa{
padding: 2px;
font-size: 20px;
width: 40px;
text-align: center;
text-decoration: none;
margin: 5px 2px;
}
.fa:hover {
opacity: 0.7;
}
.fa-twitter {
background-color: #E64040;
color: white;
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _4 .
border-radius: 50%;
width: 27px;
height: 27px;
margin-bottom: 10px;
text-align: center;
padding-top: 4px;
}
.bar {
background-color: #E64040;
width: 100%;
height: 250px;
position: absolute;
bottom: -140px;
display: flex;
}
.p1,
.p2,
.p3,
.p4 {
margin-top: 15px;
margin-left: 15px;
margin-right: 150px;
}
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _5 .
.material-icons {
background-color: #78D6CE;
color: #E64040;
border-radius: 50%;
margin-bottom: 15px;
width: 30px;
height: 30px;
text-align: center;
padding-top: 2px;
}
</style>
</head>
<body>
<div class="bar">
<i class="material-icons material-icons-outlined" id="btn">phone</i>
<div class="p1">
<p style="margin-top:-15px;">Call</p>
<p>7</p>
</div>
<i class="material-icons material-icons-outlined" id="btn">email</i>
<div class="p2">
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _6 .
<p style="margin-top:-15px;">Contact<br></p>
<p>[email protected]</p>
</div>
<i class="material-icons material-icons-outlined" id="btn">add</i>
<div class="p3">
<p style="margin-top:-15px;">Follow me</p>
<i class="material-icons" style="margin-top:-5px;background-
color:#E64040;color:white;">facebook</i>
<a href="@Hema Kamani" class="fa fa-twitter"></a>
</div>
<i class="material-icons material-icons-outlined" id="btn">copyright</i>
<div class="p4">
<p style="margin-top:-15px;">2020 by Hema Kamani</p>
</div>
</div>
</body>
</html>
Portfolio.css
body {
background-color: #f2e6ff;
margin: 0px;
border-style: solid;
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _7 .
border-color: purple;
}
img {
margin-top: 30px;
border-radius: 550px;
margin-right: 50px;
height: 300px;
width: 300px;
float: left;
}
h2 {
margin: 0px;
font-family: "Times New Roman", Times, serif;
width: 230px;
color: #555555;
}
h5 {
margin: 0px;
font-family: "Times New Roman", Times, serif;
width: 200px;
color: #555555;
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _8 .
h1 {
font-family: "Times New Roman", Times, serif;
height: 10px;
color: #555555;
}
h3 {
font-family: "Times New Roman", Times, serif;
color: #555555;
}
a:link {
text-decoration: none;
color: black;
}
a:visited {
color: black;
}
.toplinks {
margin-left: 300px;
margin-top: -37px;
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _9 .
font-size: 15px;
}
.toplinks a {
margin-left: 10px;
color: #888888;
font-weight: bold;
}
a:hover {
color: cyan;
}
ul {
list-style-type: none;
}
li {
display: inline;
}
.circles {
background-color: #ffffff;
margin-right: 500px;
}
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _10 .
.c1 {
color: white;
font-size: 15px;
text-align: center;
align-items: center;
float: right;
width: 130px;
height: 130px;
margin: 0px 0px 0px 30px;
border-radius: 100px;
background-color: #d9d926;
}
.c2 {
color: white;
font-size: 15px;
text-align: center;
float: right;
width: 130px;
height: 130px;
margin: 0px 30px 0px 30px;
border-radius: 100px;
background-color: #33d6ff;
}
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _11 .
.c3 {
color: white;
font-size: 15px;
text-align: center;
align-items: center;
float: right;
width: 130px;
height: 130px;
margin: 0px 30px 0px 0px;
border-radius: 100px;
background-color: #E64040;
}
#CT {
color: white;
}
p{
color: #777777;
}
iframe {
width: 100%;
height: 130px;
margin-top: 100px;
margin-bottom: 0px;
background-color: #E64040;
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _12 .
OUTPUT:
2.
AIM: To create a resume using internal style sheets.
Description of tags:
Program:
<!-- Hema Kamani
1602-18-737-071-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>737-071/Resume</title>
<meta charset="utf-8">
<style>
*{
box-sizing: border-box;
a{
color: inherit;
text-decoration: none;
body {
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _14 .
margin:0px;
.header {
padding: 30px;
.start{
color: white;
font-size: 15px;
text-align: center;
align-items: center;
float: left;
width: 60px;
height: 300px;
border-radius: 100px;
background-color: #1AB81A;
img{
height:170px;
width: 170px;
float:left;
}
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _15 .
.column {
float: right;
padding: 12px;
height: 600px;
.column.left {
width: 40%;
.column.right {
width: 60%;
.column.right,.column.left {
width: 100%;
li{
list-style-type: none;
.sub{
color:#888888;
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _16 .
font-size:15px;
padding:4px;
.sub1{
font-size: 20px;
color:#1AB81A;
.main{
font-size: 25px;
color:#2E582E;
padding-top: 10px;
meter{
margin-left: 50px;
.fa.fa-circle{
color: #2E582E;
font-size: 5px;
padding-left: -5px;
padding-right:3px;
.info{
margin-top: -4px;
margin-left:5px;
color:#888888;
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _17 .
h2{
margin-top:-150px;
margin-left:800px;
color:#777777;
meter{
height: 20px;
width:200px;
</style>
</head>
<body>
<div class="header">
<div class="start">
</ul>
</div>
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _18 .
<div class="info">
<p>Hyderabad,Telangana</p>
<p>+91 7013480365</p>
<p>[email protected]</p>
<p><a href="https://www.linkedin.com/in/hemakamani-8bb430187/"
target="blank">Linkedin/HemaKamani</a></p>
</div>
</div>
<div class="row">
<ul>
<ul>
<li class="sub">
</li>
<li class="sub">
08/2018 - Present
</li>
<li class="sub1";>Intermediate</li>
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _19 .
<li class="sub">
</li>
<li class="sub">
06/2016 - 03/2018
</li>
<li class="sub1">SSC</li>
</ul>
</li>
<ul>
<li class="sub">2021</li>
<li class="sub">2016-2017</li>
<li class="sub">2018-2019</li>
<li class="sub">2018-2019</li>
</ul>
</li>
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _20 .
<ul>
Nationality : Indian
Religion : Hindu
Blood Group : O+
</pre></li>
</ul>
</li>
</ul>
</div>
<ul>
<ul>
</ul>
<ul>
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _21 .
</ul>
<ul>
</ul>
</ul>
</ul>
</ul>
</div>
</div>
</body>
</html>
Output:
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _23 .
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _24 .
PRELAB QUESTIONS:
1.How can you add style In html document?
<h1>-<h6>
<header>
<hr>
<li>
<div>
<main>
<nav>
<noscript>
<ol>
<p>
<pre>
<section>
<table>
<ul>
<a>
<abbr>
<acronym>
<b>
<bdo>
<big>
<br>
<button>
<cite>
<code>
<dfn>
<em>
<i>
<img>
<input>
<kbd>
There are a number of additional tags that allow us to group related HTML content together.
Some examples include <header> , <section> , <article> and <footer> . All of these HTML
elements (including <div> ) have no effect on the HTML content itself, but instead group and
contain other elements.
HTML layouts provide a way to arrange web pages in well-mannered, well-structured, and in
responsive form or we can say that HTML layout specifies a way in which the web pages can be
arranged. Web-page layout works with arrangement of visual elements of an HTML document.
HTML <a> tag provides you option to specify an email address to send an email. While using
<a> tag as an email tag, you will use mailto: email address along with href attribute. Following
is the syntax of using mailto instead of using http. This code will generate the following link
which you can use to send email.
When you try to open the external CSS file in a browser, the browser cannot open the file,
because the file has a different extension. The only way to use an external CSS file is to reference
it using tag within another HTML document.
In the CSS, a class selector is a name preceded by a full stop (“.”) and an ID selector is a name
preceded by a hash character (“#”). The difference between an ID and a class is that an ID can
be used to identify one element, whereas a class can be used to identify more than one.
The float CSS property places an element on the left or right side of its container, allowing text
and inline elements to wrap around it.
The Overflow Method relies on setting the overflow CSS property on a parent element. If this
property is set to auto or hidden on the parent element, the parent will expand to contain the
floats, effectively clearing it for succeeding elements.
TAGS USED:
1) <script> - The <script> tag is used to embed a client-side script (JavaScript).
The <script> element
1. either contains scripting statements
2) <button> - The <button> tag defines a clickable button. Inside a <button>
element you can put text
2. (and tags like <i> , <b> , <strong> , <br> , <img> , etc.)
3) <input> - The <input> tag specifies an input field where the user can enter
data. The <input> element
3. is the most important form element.
4) <label> - The <label> tag defines a text label for the <input> tag. The label is
a normal text, by clicking
4. which, the user can select the form element.
5) <option> - The <option> tag in HTML is used to choose an option from a
Drop-Down menu. This tag
5. can be used with or without any attributes and needed value can be sent to
the server.
6) <select> - The <select> element is used to create a drop-down list. The
<select> element is most often
6. used in a form, to collect user input.
7) <textarea> - The <textarea> tag defines a multi-line text input control. The
<textarea> element is often
7. used in a form, to collect user inputs like comments or reviews.
8) <form> - <form> tag is used for creating a form for user input. A form can
contain text fields,checkboxes, radio-buttons and more. Forms are used to
pass user-data to a specified URL.
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
1.Aim:
Write a JavaScript program to find and print the first 5 happy numbers.
Program:
<!-- Hema Kamani-->
<!-- 1602-18-737-071 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function happy_number(num) {
var m, n;
var c = [];
while (num != 1 && c[num] !== true) {
c[num] = true;
m = 0;
while (num > 0) {
n = num % 10;
m += n * n;
num = (num - n) / 10;
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
}
num = m;
}
return (num == 1);
}
var cnt = 5;
var i = 1;
var str = 'First 5 happy numbers are : ';
while (cnt > 0) {
cnt--;
while (!happy_number(i))
i++;
str = str + (i + ", ");
i++;
}
console.log('First 5 happy numbers are : ' + str);
document.write(str)
</script>
</head>
<body>
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
</body>
</html>
Output:
Result:
Write a JavaScript program to find and print the first 5 happy numbers is executed
successfully.
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
2.Aim:
Write a script that reads a series of pairs of numbers as item number and quantity and
output the entire cost of them.
Program:
<!-- Hema Kamani-->
<!-- 1602-18-737-071 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<p>1) Tomatos: $21.75</p>
<p>2) Onions: $12.00</p>
<p>3) Potato: $7.50</p>
<p>4) Brinjal: $9.25</p>
<p>5) Ladyfinger: $30.00</p>
<p>0) Stop the Program</p>
<br>
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
<script>
function cost() {
var cost = 0;
while (true) {
var x = prompt("Enter Product number:");
x = parseInt(x)
if (x == 0) {
break;
}
var y;
switch (x) {
case 1:
y = prompt("Enter Quantity:")
cost = cost + y * 21.75;
break;
case 2:
y = prompt("Enter Quantity:")
cost = cost + y * 12.0;
break;
case 3:
y = prompt("Enter Quantity:")
cost = cost + y * 7.5;
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
break;
case 4:
y = prompt("Enter Quantity:")
cost = cost + y * 9.25;
break;
case 5:
y = prompt("Enter Quantity:")
cost = cost + y * 30.0;
break;
default:
alert("Wrong option selected, Choose correct one")
break;
}
}
z = document.getElementById("total")
z.innerHTML = "Total cost is :" + cost;
}
</script>
</body>
</html>
Output:
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
3.Aim:
Write a js program generates random dimensions of picture.
Program:
<!-- Hema Kamani-->
<!-- 1602-18-737-071 -->
<!-- 20-04-2021 -->
<!DOCTYPE html>
<html>
<title>Question-3</title>
<body>
<center>
<h2>I am Groot</h2>
</center>
<center><img id="myImg" src="C:\Users\benit\Downloads\groot.jpg"></center>
<script>
document.getElementById("myImg").width = Math.floor(Math.random() *
500) + 100;
document.getElementById("myImg").height = Math.floor(Math.random() *
500) + 100;
</script>
</body>
</html>
Output:
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
Result:
To write a js program generates random dimensions of picture is executed successfully.
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
4.Aim:
Write a program to display picture array in loop.
Program:
<!-- Hema Kamani-->
<!-- 1602-18-737-071 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Question-4</title>
</head>
<body>
<center>
<div>
<p><b>Image Slide Show</b></p>
<img id="img" height="600" width="1000" src="D:\webtechlab\images\
img1.jpeg"><br><br>
<button onclick="next()">Next</button>
</div>
</center>
<script>
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
Result:
To write a program to display picture array in loop is executed successfully.
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
5.Aim:
Write a program explains about event handling.
Program:
<!-- Hema Kamani-->
<!-- 1602-18-737-071 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Question-5</title>
</head>
<body>
<form>
<p>Choose one colour :</p>
<pre>
<input type="radio" name="bgcRbtns" class="radioColor" value="Light_Blue">Light
Blue
<input type="radio" name="bgcRbtns" checked class="radioColor"
value="Light_Yellow">Light Yellow
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
}
for (let i = 0; i < radioButtons.length; i++) {
radioButtons[i].addEventListener('change', function (e) {
console.log(e)
if (e.target.value == "Light_Blue") {
document.body.style.backgroundColor = "lightblue"
colorText.innerText = 'Light Blue'
}
if (e.target.value == "Light_Yellow") {
document.body.style.backgroundColor = "lightyellow"
colorText.innerText = 'Light Yellow'
}
if (e.target.value == "Light_Green") {
document.body.style.backgroundColor = "lightgreen"
colorText.innerText = 'Light Green'
}
})
}
document.getElementById('radioCount').innerText = radioButtons.length
</script>
</body>
</html>
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
Output:
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
Result:
To write a program explains about event handling is executed successfully.
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
6.Aim:
Create a form with given validations.
Program:
<!-- Hema Kamani-->
<!-- 1602-18-737-071 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
function func() {
var username = document.f1.username.value;
var password = document.f1.password.value;
var email = document.f1.email.value;
var phone = document.f1.phone.value;
if (username.match(exp1)) {
}
else {
alert("enter only characters and whitespaces");
return false;
}
}
</script>
</head>
<body>
<div style="text-align: center;">
<img src="https://www.vce.ac.in/img/vlogo.gif" alt="" style="width: 200px; height:
200px;">
<form action="" name="f1">
<h1 style="margin-top: 0;">STUDENT REGISTRSTION FORM</h1>
<br>
<label for="username">Username</label>
<input type="text" id="username" required name="username" pattern="[a-z\s]+"
oninvalid="setCustomValidity('Should contain only letters and spaces')"
oninput="setCustomValidity('')">
<br>
<br>
<label for="password">Password</label>
<input type="password" id="password" required name="password"
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$"
oninvalid="setCustomValidity('Should contain 1 lowercase, 1 number, 1 uppercase
& 8characters minimum')"
oninput="setCustomValidity('')">
<br>
<br>
<label for=" email">Email</label>
<input type="email" id="email" required name="email" pattern="[a-zA-Z0-9_\-\.]+
[@][a-z]+[\.][a-z]{2,}"
oninvalid="setCustomValidity('Should contain eg: [email protected]')"
oninput="setCustomValidity('')">
<br>
<br>
<label for="phone">Phone:</label>
<input type="text" id="phone" required name="phone" pattern="[0-9]{10}"
oninvalid="setCustomValidity('Should contain 10 digits only')"
oninput="setCustomValidity('')">
<br>
<br>
Select languages known:
<input type="checkbox" id="english" name="english" value="english">
<label for="english">English</label>
<input type="checkbox" id="hindi" name="hindi" value="hindi">
<label for="hindi">Hindi</label>
<input type="checkbox" id="telugu" name="telugu" value="telugu">
<label for="telugu">Telugu</label>
<br>
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
<br>
<input type="radio" name="gender" id="male" value="male">
<label for="male">Male</label>
<input type="radio" name="gender" id="female" value="demale">
<label for="female">Female</label>
<br>
<br>
<label for="state">Select State</label>
<select name="" id="state">
<option value="telangana">Telangana</option>
<option value="andrapradesh">Andra Pradesh</option>
</select>
<br>
<br>
<br>
<br>
<button>Submit Query</button>
<button type="reset">Reset</button>
</form>
</div>
</body>
</html>
Output:
Result:
Create a form with given validations is executed successfully.
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
Viva Questions
1.What is JavaScript?
Ans:
JavaScript is the Programming Language for the Web. JavaScript can update and change
both HTML and CSS. JavaScript can calculate, manipulate and validate data.
2. Name some of the JavaScript features?
Ans:
4. Template Literal
5. Default Parameters
Ans:
Advantages of JavaScript:
Speed.
Server Load.
Interoperability.
Disadvantages of JavaScript:
Client-Side Security.
Browser Support.
Ans:
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
Yes, JS is case-sensitive.
5. How can you create an Object in JavaScript? How can you read properties of an Object
in JavaScript?
Ans:
6. How can you create an Array in JavaScript? How to read elements of an array in JavaScript?
Ans:
Create:
var cars = ["Saab", "Volvo", "BMW"];
How to read:
var cars = ["Saab", "Volvo", "BMW"];
document.getElementById("demo").innerHTML = cars[0];
7. What is a named & anonymous functions in JavaScript? Give an example for each.
Ans:
show();
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
8. Illustrate with examples the different ways in which event handling can be done using
JavaScript.
Ans:
9 What is HTML DOM? Give an example for creating and inserting new a node using the
document object.
Ans:
Create:
createElement()
Insert:
node.insertbefore()
10. Give an example for removing a node and replacing a node, using the document
object.
Ans:
Remove:
Node.remove()
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: A
Replace:
parentNode.replaceChild(newnode,oldnode):
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _1 .
LAB-5
Description of Tags:
1) <script> - The <script> tag is used to embed a client-side script (JavaScript).
The <script> element
1. either contains scripting statements
2) <button> - The <button> tag defines a clickable button. Inside a <button>
element you can put text
2. (and tags like <i> , <b> , <strong> , <br> , <img> , etc.)
3) <input> - The <input> tag specifies an input field where the user can enter
data. The <input> element
3. is the most important form element.
4) <label> - The <label> tag defines a text label for the <input> tag. The label is
a normal text, by clicking
4. which, the user can select the form element.
5) <option> - The <option> tag in HTML is used to choose an option from a
Drop-Down menu. This tag
5. can be used with or without any attributes and needed value can be sent to
the server.
6) <select> - The <select> element is used to create a drop-down list. The
<select> element is most often
6. used in a form, to collect user input.
7) <textarea> - The <textarea> tag defines a multi-line text input control. The
<textarea> element is often
7. used in a form, to collect user inputs like comments or reviews.
8) <form> - <form> tag is used for creating a form for user input. A form can
contain text fields,checkboxes, radio-buttons and more. Forms are used to
pass user-data to a specified URL.
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _2 .
Exp1:
Program:
<!--1602-18-737-071 Hema Kamani-->
<head>
<title>737-071/5.1_radioButton-bg</title>
<script type="text/javascript">
window.addEventListener('click', function(){
if(document.getElementById("1").checked==true){
document.getElementById("colorText").innerHTML="Light_Blue";
document.body.style.backgroundColor = "lightblue";
}
if(document.getElementById("2").checked==true){
document.getElementById("colorText").innerHTML="Light_Yellow";
document.body.style.backgroundColor = "lightyellow";
}
if(document.getElementById("3").checked==true){
document.getElementById("colorText").innerHTML="Light_Green";
document.body.style.backgroundColor = "lightgreen";
}
});
</script>
<style>
input:checked {
height: 50px;
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _3 .
width: 50px;
}
</style>
</head>
<body >
<form>
<p>Choose one colour :</p>
<blockquote cite="http://">
<input type="radio" name="bgcRbtns" class="radioColor" value="Light_Blue"
id="1">Light Blue<br>
<input type="radio" name="bgcRbtns" class="radioColor" value="Light_Yellow"
id="2">Light Yellow<br>
<input type="radio" name="bgcRbtns" class="radioColor" value="Light_Green"
id="3">Light Green
</blockquote>
OUTPUT:
Exp 2:
Program:
<!--1602-18-737-071 Hema Kamani-->
<html>
<head>
<title>737-071/Vasavi form</title>
<script>
function func() {
var username = document.f1.username.value;
var password = document.f1.password.value;
var email = document.f1.email.value;
var phone = document.f1.phone.value;
var exp1 = /[a-z\s]+$/;
if (username.match(exp1)==false) {
alert("enter only characters and whitespaces");
return false;
}
}
</script>
</head>
<body >
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _6 .
<label for="female">Female</label>
<br>
<br>
<label for="state">Select State:</label>
<select name="" id="state">
<option value="telangana">Telangana</option>
<option value="andrapradesh">Andra Pradesh</option>
</select>
<br>
<br>
Give your comment:
<br>
<textarea name="" id="" cols="40" rows="5"></textarea>
<br>
<br>
Select resume to upload
<input id="loadFileXml" type="button"
onclick="document.getElementById('file').click();" value="Browse.." />
<input type="file" style="display:none;" id="file" name="file" />
<br>
<br>
<button>Submit Form</button>
<button type="reset">Reset</button>
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _9 .
</form>
</div>
</body>
Output:
3.
Program:
<!DOCTYPE html>
<html lang="en">
<!--1602-18-737-071
Hema Kamani-->
<head>
<title>737-071/5.2_international conference.html</title>
<script>
arr=new Array();
arr.push('<div id="1" style="display:inline">Hotel 1 Select Atleast five accomodations
:<br><input type="checkbox" id="BreakFast" name="" value="1"><label
for="BreakFast">Break Fast</label><input type="checkbox" id="Lunch" name=""
value="2"><label for="Lunch">Lunch</label><input type="checkbox" id="Dinner" name=""
value="3"><label for="Dinner">Dinner</label><input type="checkbox" id="TempArt"
name="" value="4"><label for="TempArt">Temporary Art Gallery</label><input
type="checkbox" id="Spa" name="" value="5"><label for="Spa">Spa</label><input
type="checkbox" id="Massage" name="" value="6"><label
for="Massage">Massage</label><input type="checkbox" id="Sauna" name=""
value="7"><label for="Sauna">Sauna</label><input type="checkbox" id="Happy Hour"
name="" value="8"><label for="Happy Hour">Happy Hour</label><input type="checkbox"
id="Sports" name="" value="9"><label for="Sports">Sports
Equipment</label><br><br></div>');
arr.push('<div id="2" style="display:inline">Hotel 2 Select Atleast five accomodations
:<br><input type="checkbox" id="BreakFast" name="" value="1"><label
for="BreakFast">Break Fast</label><input type="checkbox" id="Lunch" name=""
value="2"><label for="Lunch">Lunch</label><input type="checkbox" id="Dinner" name=""
value="3"><label for="Dinner">Dinner</label><input type="checkbox" id="TempArt"
name="" value="4"><label for="TempArt">Temporary Art Gallery</label><input
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _11 .
document.getElementById('P').innerHTML=arr[Number(k)-1];
}
function abc() {
var count=0;
var markedCheckbox =
document.querySelectorAll('input[type="checkbox"]:checked');
for (var checkbox of markedCheckbox) {
count++;
}
document.body.append(count + ' ');
if(count>=5)
{
return true;
}
else
{
alert("please select atleast 5 Accomdations");
return false;
}
}
</script>
</head>
<body >
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _13 .
<br>
<br>
Select Currency:
<input type="radio" name="currency" id="Rupees" value="male">
<label for="Rupees">Rupees</label>
<input type="radio" name="currency" id="Dollar" value="demale">
<label for="Dollar">Dollar</label>
<br>
<br>
<label for="PMethod">Select Payment Method:</label>
<select name="" id="PMethod">
<option value="1">credit card</option>
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _14 .
<button>Submit Form</button>
<button type="reset">Reset</button>
</form>
</div>
</body>
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _15 .
Output:
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _16 .
PRELAB QUESTIONS:
JavaScript is a text-based programming language used both on the client-side and server- side that
allows you to make web pages interactive. Where HTML and CSS are languages that give structure
and style to web pages, JavaScript gives web pages interactive elements that engage a user.
Javascript Features
• Dynamic Typing.
• Functional Style.
• Platform Independent.
• Prototype-based.
• Interpreted Language.
Advantages of JavaScript:
• Regardless of where you host JavaScript, it always gets executed on client environment to
save lots of a bandwidth and make execution process fast.
• The biggest advantage to JavaScript having a ability to support all modern browsers and
produce an equivalent result.
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _18 .
• Global companies support community development by creating projects that are important. An
example is Google (created Angular framework) or Facebook (created the React.js framework).
Disadvantages of JavaScript:
• This may be difficult to develop large applications, although you’ll also use the
TypeScript overlay.
• This applies to larger front-end projects. The configuration is often a tedious task to the
amount of tools that require to figure together to make an environment for such a project. This is
often directly associated with the
library’s operation.
• The main problem or disadvantage in JavaScript is that the code is always visible to everyone
anyone can view JavaScript code.
• No matter what proportion fast JavaScript interpret, JavaScript DOM (Document Object
Model) is slow and can be a never fast rendering with HTML.
• If the error occurs in the JavaScript, it can stop to render the whole website. Browsers are
extremely tolerant of JavaScript errors.
All JavaScript identifiers are case sensitive. JavaScript does not interpret VAR or Var as the keyword
var.
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _19 .
5.How can you create an Object in JavaScript? How can you read properties of an Object in
JavaScript?
JavaScript has a number of predefined objects. In addition, you can create your own objects. You can
create an object using an object initializer. Alternatively, you
can first create a constructor function and then instantiate an object invoking that function in
conjunction with the new operator.
6. How can you create an Array in JavaScript? How to read elements of an array in
JavaScript?
• Using an array literal is the easiest way to create a JavaScript Array. var array_name =
[item1, item2, ...];
• With JavaScript, the full array can be accessed by referring to the array name:
7. What is a named & anonymous functions in JavaScript? Give an example for each.?
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _20 .
officer()
8. Illustrate with examples the different ways in which event handling can be done using
JavaScript.
<form>
</form>
</div> etc
9. What is HTML DOM? Give an example for creating and inserting new a node using the
document object.
The HTML DOM is a standard object model and programming interface for HTML. It defines:
10. Give an example for removing a node and replacing a node, using the document object.
AIM: Use the MVC Pattern and develop an application using servlets to take the roll number of a
student as input and display the branch of the given student.
[732-Civil, 733-CSE, 734-EEE, 735-ECE, 736-Mechanical, 737-IT]
PROGRAM:
Index.html:
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Roll Finder</title>
</head>
<body>
</body>
</html>
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: B
Roll no: 1602-18-737-071 Name: Hema Kamani Date of Submission: 21.04.2021
Name of the course:Web Technologies Lab
Web.xml:
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
session.setAttribute(rollNumber, dept);
}else{
if((session.getAttribute(rollNumber))!= null){
value =(String)
session.getAttribute(rollNumber);
}
else{
session.setAttribute(rollNumber, dept);
}
}
String x="";
if (value=="")
x=dept;
else
x=value;
out.println("<html>" +
"<head><title>
Department</title></head>" +
"<body>"+
"<h1>"+ "The roll number " +rollNumber
+" belongs to "+x+" department"+ "</h1>"
+"</body>"+"</html>");
}
}
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: B
Roll no: 1602-18-737-071 Name: Hema Kamani Date of Submission: 21.04.2021
Name of the course:Web Technologies Lab
StudInfo.java
package rollFinder;
import java.util.*;
public class StudInfo {
private String rollNumber = "";
private int[] rNoComps = new int[4];
private String dept = "";
break;
case 735:
dept = "Electronics and Communications";
break;
case 734:
dept = "Electrical and Electronics";
break;
default :
dept = "Wrong input";
}
return dept;
}
OUTPUT:
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: B
Roll no: 1602-18-737-071 Name: Hema Kamani Date of Submission: 21.04.2021
Name of the course:Web Technologies Lab
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: B
Roll no: 1602-18-737-071 Name: Hema Kamani Date of Submission: 21.04.2021
Name of the course:Web Technologies Lab
RESULT:
Dynamic web project for finding department of the student if roll number is given is created success
fully.
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: B
Roll no: 1602-18-737-071 Name: Hema Kamani Date of Submission: 21.04.2021
Name of the course:Web Technologies Lab
VIVA QUESTIONS
Read the explicit data sent by the clients (browsers). This includes an HTML
form on a Web page or it could also come from an applet or a custom HTTP
client program.
Read the implicit HTTP request data sent by the clients (browsers). This includes
cookies, media types and compression schemes the browser understands, and so
forth.
Process the data and generate the results. This process may require talking to a
database, executing an RMI or CORBA call, invoking a Web service, or
computing the response directly.
Send the explicit data (i.e., the document) to the clients (browsers). This
document can be sent in a variety of formats, including text (HTML or XML),
binary (GIF images), Excel, etc.
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: B
Roll no: 1602-18-737-071 Name: Hema Kamani Date of Submission: 21.04.2021
Name of the course:Web Technologies Lab
Send the implicit HTTP response to the clients (browsers). This includes telling
the browsers or other clients what type of document is being returned (e.g.,
HTML), setting cookies and caching parameters, and other such tasks.
How many objects of a servlet are created?
Only one object at the time of first request by servlet or web container.
3. Illustrate the servlet life cycle and explain the purpose of each of the
following methods and when do they get invoked:init() service() doGet()
doPost() destroy()
A servlet life cycle can be defined as the entire process from its creation till the destruction.
The following are the paths followed by a servlet.
The servlet is initialized by calling the init() method.
The servlet calls service() method to process a client's request.
The servlet is terminated by calling the destroy() method.
Finally, servlet is garbage collected by the garbage collector of the JVM.
init() method:
The init method is called only once. It is called only when the servlet is created, and not
called for any user requests afterwards. So, it is used for one-time initializations, just as
with the init method of applets.
Service() method:
The service() method is the main method to perform the actual task. The servlet
container (i.e. web server) calls the service() method to handle requests coming from the
client( browsers) and to write the formatted response back to the client.
doGet() method
A GET request results from a normal request for a URL or from an HTML form that has
no METHOD specified and it should be handled by doGet() method.
doPost() method
A POST request results from an HTML form that specifically lists POST as the
METHOD and it should be handled by doPost() method.
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: B
Roll no: 1602-18-737-071 Name: Hema Kamani Date of Submission: 21.04.2021
Name of the course:Web Technologies Lab
Destroy() method
The destroy() method is called only once at the end of the life cycle of a servlet. This
method gives your servlet a chance to close database connections, halt background threads,
write cookie lists or hit counts to disk, and perform other such cleanup activities.
GET POST
In case of Get request, only limited amount of data In case of post request, large amount of data can be
can be sent because data is sent in header. sent because data is sent in body.
Get request is not secured because data is exposed Post request is secured because data is not exposed
in URL bar. in URL bar.
Get request can be bookmarked. Post request cannot be bookmarked.
An object of ServletContext is created by the web container at time of deploying the project.
This object can be used to get configuration information from web.xml file. There is only
one ServletContext object per web application
There can be a lot of usage of ServletContext object. Some of them are as follows:
o The object of ServletContext provides an interface between the container and servlet.
o The ServletContext object can be used to get configuration information from the
web.xml file.
o The ServletContext object can be used to set, get or remove attribute from the
web.xml file.
o The ServletContext object can be used to provide inter-application communication
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: B
Roll no: 1602-18-737-071 Name: Hema Kamani Date of Submission: 21.04.2021
Name of the course:Web Technologies Lab
6. What is the difference between Servlet Request and Servlet Context when
calling a Request Dispatcher?
Session Tracking is a way to maintain state (data) of an user. It is also known as session
management in servlet. Http protocol is a stateless so we need to maintain state
using session tracking techniques. Each time user requests to the server, server treats the
request as the new request.
Url rewriting is a process of appending or modifying any url structure while loading a
page.
The request made by client is always a new request and the server can not identify whether
the current request is send by a new client or the previous same client. Due to This
property of HTTP protocol and Web Servers are called stateless. But many times we
should know who is client in the processing request.
For example:
In any social networking site during login to till logout the server should know who is
client so that server can manage all the request according to the user need.
This problem is solved by Session in Servlet.
VASAVI COLLEGE OF ENGINEERING
Department of Information Technology
Course: BE Semester: VI Section: B
Roll no: 1602-18-737-071 Name: Hema Kamani Date of Submission: 21.04.2021
Name of the course:Web Technologies Lab
2. Communication support : Handling the communication between servlet and Web server.
3. Multithreading support : Automatically creating a new thread for every servlet request
and finishing it when the Servlet service() method is over.
4. Declarative security : Managing the security inside the XML deployment descriptor file.
Lab-7
AIM:
Use the MVC Pattern and develop an application using servlets & JSP’s to take the roll
number of a student as input and display the branch of the given student.
[732-Civil, 733-CSE, 734-EEE, 735-ECE, 736-Mechanical, 737-IT]
PROGRAM:
Index.jsp:
<!DOCTYPE html>
<html lang="en">
<!—Hema Kamani 1602-18-737-071-->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Get Department</title>
</head>
<!—Hema Kamani 1602-18-737-071-->
</html>
Output.jsp:
<!DOCTYPE html>
<html lang="en">
<!—Hema Kamani 1602-18-737-071-->
<head>
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _2 .
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<!—Hema Kamani 1602-18-737-071-->
<body>
<% String rollno=request.getParameter("rollno"); String dept=(String)request.getAttribute("dept");
%>
<h2>The Roll Number <%=rollno%> belongs to <%=dept%> Department</h2>
</body>
<!—Hema Kamani 1602-18-737-071-->
</html>
GetDept.java:
package vce.controller;
import vce.model.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
HttpSession session=request.getSession(false);
if(session==null){
dept=std.getDepartment();
if(dept.equals("Wrong input")){
response.sendRedirect("index.jsp");
return;
}
session=request.getSession();
session.setAttribute(deptno,dept);
}
else{
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _3 .
if(session.getAttribute(deptno)!=null){
dept=(String)session.getAttribute(deptno);
dept=dept+" ( Fetched from session )";
}
else{
dept=std.getDepartment();
if(dept.equals("Wrong input")){
response.sendRedirect("index.jsp");
return;
}
session.setAttribute(deptno,dept);
}
}
request.setAttribute("dept",dept);
RequestDispatcher rd=request.getRequestDispatcher("output.jsp");
rd.forward(request,response);
}
}
StudentInfo.java:
package vce.model;
import java.util.StringTokenizer;
this.deptno=rNoComps[2]+"";
}
OUTPUT:
VIVA QUESTIONS
1. What is JSP?
It stands for Java Server Pages. It is a server-side technology. It is used for creating web
application. It is used to create dynamic web content. It is an advanced version of
Servlet Technology.
JSP is better because it lets you use servlets instead of a separate program to
generate that dynamic part. Besides, SSI is really only intended for simple inclusions,
not for real programs that use form data, make database connection. JavaScript can
generate HTML dynamically on the client. However, it can only access client
environment. JavaScript can't access server-side resources like databases,
catalogues, pricing information etc.
3. what are the types of directive tags? give syntax and purpose?
A JSP directive affects the overall structure of the servlet class. It usually has the
following form –
The session attribute indicates whether or not the JSP page uses HTTP sessions. A
value of true means that the JSP page has access to a built-in session object and a
value of false means that the JSP page cannot access the built-in session object.
VASAVI COLLEGE OF
ENGINEERING
AUTONOMOUS
(Affiliated to Osmania University)
Hyderabad- 500 031
DEPARTMENT OF : INFORMATION TECHNOLOGY
NAME OF THE LABORATORY : WEB TECHNOLOGIES________
Name Hema Kamani Roll No. 1602-18-737-071 Page No. _7 .
There are 9 jsp implicit objects. These objects are created by the web container that
are available to all the jsp pages.
Out
Request
Response
Config
Application
Session
Page context
Page
Exception