EAST POINT COLLEGE OF ENGINEERING &
TECHNOLOGY
DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND
DATA SCIENCE
LAB MANUAL
WEB TECHNOLOGY LABORATORY
WEB TECHNOLOGY LABORATORY
Subject Code 21CSL481
1. Write a basic HTML code with Bold,title,body,font,break,italics,underlined tags.
2. Write a basic HTML code with ordered and unordered tags.
3. Write a necessary HTML code for Time Table. This should look similar to the one below
4. Implement a simple HTML code with the use of different CSS selectors.
5. Create a Registration form using HTML code. This should look similar to the one below
6. Write a JavaScript to design a simple calculator to perform the following operations:
sum, product, difference and quotient.
7. Write a JavaScript that calculates the squares and cubes of the numbers from 0 to
10and outputs HTML text that displays the resulting values in an HTML table format.
8. Write a JavaScript code that displays text “TEXT-GROWING” with increasing font size in
the interval of 100ms in RED COLOR, when the font size reaches 50pt it displays “TEXT-
SHRINKING” in BLUE color. Then the font size decreases to 5pt.
9. Develop and demonstrate a HTML5 file that includes JavaScript script that uses
functions for the following problems:
a. Parameter: A string
b. Output: The position in the string of the left-most vowel
c. Parameter: A number
d. Output: The number with its digits in the reverse order
Prog1: Basic Html
<html>
<head>
<title>
Welcome to HTML classes
</title>
<body>
<h1> Hello,World!</h1>
<p>This is a paragraph</p>
<p>
<font color="blue">How are you?</font>
</p>
<p>
<b> This is a bold text </b><br>
<i> This is a italic text </i><br>
<u> This is a underlined text </u><br>
</p>
</body>
</head>
</html>
Output
Prog 2:Ordered and Unordered List
<html>
<head>
<title>
Hello,World!
</title>
<body>
<h1>Subjects for fourth semester </h1>
<h2>Mathematics</h2>
<ul>
<li>Statistics</li>
<li>Probability</li>
<li>Integration</li>
</ul>
<h2>Operating Systems</h2>
<ul>
<li>Process</li>
<li>Threads</li>
</ul>
<h2>Other Subjects are</h2>
<ol>
<li>DAA</li>
<li>MCES</li>
<li>UHV</li>
</ol>
<img src="hai.jpg" alt="Rabbit" alt="Hello">
</body>
</head>
</html>
Output
Prog3 : Tables
<!DOCTYPE html>
<html>
<body>
<h1>TIME TABLE</h1>
<table border="5" cellspacing="0" align="center">
<!--<caption>Timetable</caption>-->
<tr>
<td align="center" height="50"
width="100"><br>
<b>Day/Period</b></br>
</td>
<td align="center" height="50"
width="100">
<b>I<br>9:30-10:20</b>
</td>
<td align="center" height="50"
width="100">
<b>II<br>10:20-11:10</b>
</td>
<td align="center" height="50"
width="100">
<b>III<br>11:10-12:00</b>
</td>
<td align="center" height="50"
width="100">
<b>12:00-12:40</b>
</td>
<td align="center" height="50"
width="100">
<b>IV<br>12:40-1:30</b>
</td>
<td align="center" height="50"
width="100">
<b>V<br>1:30-2:20</b>
</td>
<td align="center" height="50"
width="100">
<b>VI<br>2:20-3:10</b>
</td>
<td align="center" height="50"
width="100">
<b>VII<br>3:10-4:00</b>
</td>
</tr>
<tr>
<td align="center" height="50">
<b>Monday</b></td>
<td align="center" height="50">Eng</td>
<td align="center" height="50">Mat</td>
<td align="center" height="50">Che</td>
<td rowspan="6" align="center" height="50">
<h2>L<br>U<br>N<br>C<br>H</h2>
</td>
<td colspan="3" align="center"
height="50">LAB</td>
<td align="center" height="50">Phy</td>
</tr>
<tr>
<td align="center" height="50">
<b>Tuesday</b>
</td>
<td colspan="3" align="center"
height="50">LAB
</td>
<td align="center" height="50">Eng</td>
<td align="center" height="50">Che</td>
<td align="center" height="50">Mat</td>
<td align="center" height="50">SPORTS</td>
</tr>
<tr>
<td align="center" height="50">
<b>Wednesday</b>
</td>
<td align="center" height="50">Mat</td>
<td align="center" height="50">phy</td>
<td align="center" height="50">Eng</td>
<td align="center" height="50">Che</td>
<td colspan="3" align="center"
height="50">LIBRARY
</td>
</tr>
<tr>
<td align="center" height="50">
<b>Thursday</b>
</td>
<td align="center" height="50">Phy</td>
<td align="center" height="50">Eng</td>
<td align="center" height="50">Che</td>
<td colspan="3" align="center"
height="50">LAB
</td>
<td align="center" height="50">Mat</td>
</tr>
<tr>
<td align="center" height="50">
<b>Friday</b>
</td>
<td colspan="3" align="center"
height="50">LAB
</td>
<td align="center" height="50">Mat</td>
<td align="center" height="50">Che</td>
<td align="center" height="50">Eng</td>
<td align="center" height="50">Phy</td>
</tr>
<tr>
<td align="center" height="50">
<b>Saturday</b>
</td>
<td align="center" height="50">Eng</td>
<td align="center" height="50">Che</td>
<td align="center" height="50">Mat</td>
<td colspan="3" align="center"
height="50">SEMINAR
</td>
<td align="center" height="50">SPORTS</td>
</tr>
</table>
</body>
</html>
Output
Prog 4 :Use of CSS with selectors
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS: Selecting by class</title>
<style>
h2 {
color: rgb(0, 232, 15);
}
#rabbits-info-heading {
background-color: purple;
}
p{
color: rgb(191, 0, 255);
}
#rabbits-song {
background-color: yellow;
}
.hai {
background-color: #34495e;
}
</style>
</head>
<body>
<h1>All about rabbits!</h1>
<h2 id="rabbits-info-heading">Basic info</h2>
<p>Rabbits are little creatures with long ears and puffy tails, and they move
their nose up and down in an adorable way. They eat the most orange vegetables
in <em>our</em> world, and <strong>they reproduce more than any human
<em>ever</em> has</strong>.</p>
<h2>Songs</h2>
<p id="rabbits-song">Little Bunny Foo Foo, <br>
I don't want to see you <br>
scooping up the field mice <br>
and bopping them on the head!</p>
<p class="hai">And down came the Good Fairy <br>
And she said <br>
"Little bunny Foo Foo <br>
I don't like you're attitude <br>
Scooping up the field mice <br>
And bopping 'em on the head" <br>
</p>
<p>I'll give you 3 chances. <br>
Then I'll turn you into a goon! <br>
The next day…</p>
<img src="rabbit.jpg" alt="Rabbit" width="203">
</body>
</html>
Output
Prog 5 : Form Elements
<!doctype html>
<html>
<head>
<title> HTML Form</title>
<style>
th{
font-size:30px;
background-color:#FFA;
color:red;
}
td{
padding: 2px 15px;
background-color:#0CF;
}
*{
font-size:16px;
}
</style>
</head>
<body>
<form>
<table border="3" cellspacing="5px">
<tr> <th colspan="2"> Registration Form </th> </tr>
<tr> <td>Enter Name</td>
<td> <input class="" type="text" /> </td>
</tr>
<tr> <td>Enter Password</td>
<td><input type="password" /></td></tr>
<tr> <td>Enter Address</td>
<td><textarea rows="3"></textarea></td></tr>
<tr> <td>Select Game</td><td>
<input type="checkbox"/>Hockey <br />
<input type="checkbox"/>Football<br />
<input type="checkbox"/>Badminton<br />
<input type="checkbox"/>Cricket<br />
<input type="checkbox"/>volleyball
</td></tr>
<tr> <td>Gender</td><td>
<input type="radio" name ="s1" checked="true" /> Male
<input type="radio" name ="s1"/> Female
</td></tr>
<tr> <td>Select ur age</td><td>
<select class="">
<option>Select </option>
<option>15</option>
<option>16</option>
<option>17</option>
<option>18</option>
<option>19</option>
<option>20</option>
<option>21</option>
<option>More than 22</option>
</select>
</td></tr>
<tr> <td>Select Photo</td>
<td><input type="file" />
</td></tr>
<tr><td colspan="2">
<input type="button" value="Click Me" style="width:33%;
height:40px;" />
<input type="reset" style="width:32%; height:40px;" />
<input type="submit" value="Submit Form" style="width:33%;
height:40px;" />
</td></tr>
</table>
</form>
</body>
</html>
Output
Prog 6 Calculator
<html>
<head>
<title>Calculator</title>
<style>
body
{
margin:150px;
}
input{
width:100%;
height:100%;
}
</style>
<script>
function display(x){
document.getElementById("text1").value+=x;
}
function compute(){
var x =
document.getElementById("text1").value;
document.getElementById("text1").value =
eval(x);
}
</script>
</head>
<body>
<center>
<form>
<table border="1" bgcolor="lime">
<tr>
<th colspan=4><h1>Calculator</h1></th>
</tr>
<tr >
<td colspan=4><input type="text"
id="text1" placeholder="0" style="text-align:right;"/></td>
</tr>
<tr>
<td><input type="reset" value="C"
/></td>
<td><input type="button" value="/"
onClick="display(this.value)"/></td>
<td><input type="button" value="*"
onClick="display(this.value)"/></td>
<td><input type="button" value="-"
onClick="display(this.value)"></td>
</tr>
<tr>
<td><input type="button" value="7"
onClick="display(this.value)"></td>
<td><input type="button" value="8"
onClick="display(this.value)"></td>
<td><input type="button" value="9"
onClick="display(this.value)"></td>
<td rowspan=2><input type="button"
value="+" style="height:50px;" onClick="display(this.value)"></td>
</tr>
<tr>
<td><input type="button" value="4"
onClick="display(this.value)"></td>
<td><input type="button" value="5"
onClick="display(this.value)"></td>
<td><input type="button" value="6"
onClick="display(this.value)"></td>
</tr>
<tr>
<td><input type="button" value="1"
onClick="display(this.value)"></td>
<td><input type="button" value="2"
onClick="display(this.value)"></td>
<td><input type="button" value="3"
onClick="display(this.value)"></td>
<td rowspan=2><input type="button"
value="=" style="height:48px;" onClick="compute()" ></td>
</tr>
<tr>
<td colspan=2><input type="button"
value="0" onClick="display(this.value)" style="width:100%"></td>
<td><input type="button" value="."
onClick="display(this.value)"></td>
</tr>
</table>
</form>
</center>
</body>
</html>
Output
Prog 7.Squares and Cubes
<html>
<head>
<style> table,tr, td
border: solid black;
width: 33%;
text-align: center;
border-collapse: collapse; background-color:lightblue;
table { margin: auto; }
</style>
<script>
document.write( "<table><tr><thcolspan='3'> NUMBERS FROM 0 TO 10 WITH
THEIR SQUARES AND CUBES </th></tr>" );
document.write( "<tr><td>Number</td><td>Square</td><td>Cube</td></tr>"
);
for(var n=0; n<=10; n++)
document.write( "<tr><td>" + n + "</td><td>" + n*n + "</td><td>" + n*n*n +
"</td></tr>" ) ;
document.write( "</table>" ) ;
</script>
</head>
</html>
Output
Prog8:Text Growing and Shrinking
<html>
<head>
<style>
p{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
</style>
</head>
<body>
<p id="demo"></p>
<script>
var var1 = setInterval(inTimer, 1000);
var fs = 5;
var ids = document.getElementById("demo");
function inTimer() {
ids.innerHTML = 'TEXT GROWING'; ids.setAttribute('style', "font-size: " + fs + "px;
color: red"); fs += 5;
if(fs >= 50 ){
clearInterval(var1);
var2 = setInterval(deTimer, 1000);
function deTimer() {
fs -= 5;
ids.innerHTML = 'TEXT SHRINKING'; ids.setAttribute('style', "font-size: " + fs +
"px; color: blue"); if(fs === 5 ){
clearInterval(var2);
}
</script>
</body>
</html>
Output
Prog 9: Javascript Functions
<html>
<body>
<script type="text/javascript">
var str = prompt("Enter the Input","");
if(!(isNaN(str)))
var num,rev=0,remainder;
num = parseInt(str);
while(num!=0) {
remainder = num%10;
num = parseInt(num/10);
rev = rev * 10 + remainder;
alert("Reverse of "+str+" is "+rev);
else
str = str.toUpperCase();
for(var i = 0; i < str.length; i++) {
var chr = str.charAt(i);
if(chr == 'A' || chr == 'E' || chr == 'I' || chr == 'O' || chr == 'U')break;
}
if( i < str.length )
alert("The position of the left most vowel is "+(i+1));
else
alert("No vowel found in the entered string");
</script>
</body>
</html>
Output