Web Programming Lab Manual
Web Programming Lab Manual
DEPARTMENT OF AI & ML
IV SEMESTER
WEB PROGRAMMING
(2022-23)
LABORATORY MANUAL
BATCH :
Dept. of Artificial Intelligence & Machine Learning Web Programming
4 Write an HTML code to create a Home page having three links: About Us, Our
Services and Contact Us. Create separate web pages for the three links.
5 Write an HTML code to create a login form. On submitting the form, the user should
get navigated to a profile page.
6 Write an HTML code to create a frameset having header, navigation and content
sections.
8 Write a Java script to prompt for users name and display it on the screen.
9 Design HTML form for keeping student record and validate it using Java script
<html>
<head>
<title> HELLO WORLD </title>
<head>
<body>
HELLO WORLD !!!
</body>
</html>
Output:
1. b. Write a HTML code to display “WEB PROGRAMMING” using various heading tags
<html>
<head>
<title> WEB PROGRAMMING </title>
<head>
<body>
<h1> Heading 1 </h1>
<h2> Heading 1 </h2>
<h3> Heading 1 </h3>
<h4> Heading 1 </h4>
<h5> Heading 1 </h5>
<h6> Heading 1 </h6>
</body>
</html>
Output:
<html>
<head>
<title>Education details</title>
</head>
<body>
<h1 align="center" style="color: blue">EDUCATION DETAILS</h1><br><br>
<table border="3” bordercolor="black" cellspacing="3" cellpadding="7">
<th>SNo</th>
<th>Course</th>
<th>University</th>
<th>College</th>
<th>Year of Passing</th>
<th>Percentage</th>
<tr>
<td>1</td>
<td>BE</td>
<td>VTU</td>
<td>SEACET</td>
<td>2015</td>
<td>90</td>
</tr>
<tr>
<td>2</td>
<td>MTECH</td>
<td>VTU</td>
<td>SEACET</td>
<td>2023</td>
<td>95</td>
</tr>
</table>
</body>
</html
Output:
<html>
<head>
<title>resume</title>
</head>
<body>
<h1 align="center" style="color:black">RESUME</h1><br>
<p style="text-align:left;">Student 1<br>
SEACET, Ekta Nagar<br> K R Puram
Bangalore-560016<br>
</p>
<p style="text-align:right;">Email:seacet@gmail.com<br>
contact number:1234567899<br>
</p>
<h3>Objective:</h3>
<p> I want to excel in the field of Internet of Things with hard work, perseverance and
dedication.</p>
<h3>Educational Qualifications:</h3>
<table border="3"background="purple" cellspacing="10" cellpadding="10"
brcolor="purple">
<th>SNo</th>
<th>Course</th>
<th> University</th>
<th>College</th>
<th>Year of passing</th>
<th>Percentage</th>
<tr>
<td>1</td>
<td>BE</td>
<td>VTU</td>
<td>SEACET</td>
<td>2018</td>
<td>80</td>
</tr>
<tr>
<td>2</td>
<td>MTECH</td>
<td>VTU</td>
<td>SEACET</td>
<td>2020</td>
<td>85</td>
</tr>
</table>
<h3>Techincal Skills:</h3>
<ul style="circle">
<li><b>Computer </b>:Python, Java, IoT, Artificial Intelligence, Data Science</li>
<li><b>Typing</b> :English
</ul>
<h3>Hobbies:</h3>
<ul style="circle">
<li>Reading books, dancing ,newspaper</li>
</ul>
<h3>Experience:</h3>
<ul style="circle">
<li>ASUS PUBLICATION COMPUTER OPERATION</li>
</ul>
</head>
</body>
</html>
OUTPUT:
4. Write an HTML code to create a Home page having three links: About Us, Our Services
and Contact Us. Create separate web pages for the three links.
Filename: pg3.html
<html>
<head>
<title>Computer Service</title>
</head>
<body bgcolor="silver">
<font size="8">
<a href="aboutus.html">ABOUT US</a> <br>
<a href="services.html">OUR SERVICES</a> <br>
<a href="contact.html">CONTACT US</a></font> <br>
</body>
</html>
Filename: aboutus.html
<html>
<head>
<title> ABOUT US </title>
</head>
<body>
<p> Our computer service is here to provide you with expert assistance. <br>Whatever your
needs may be, get in touch with us today.
<table>
<caption>
<b>Business Hours</b></caption>
<tr><td>Mon: 10:00 AM – 7:00 PM</td></tr>
<tr><td>Tue: 10:00 AM – 7:00 PM</td></tr>
<tr><td>Wed: 10:00 AM – 7:00 PM</td></tr>
<tr><td>Thu: 10:00 AM – 7:00 PM</td></tr>
<tr><td>Fri: 10:00 AM – 7:00 PM</td></tr>
<tr><td>Sat: 10:00 AM – 7:00 PM</td></tr>
<tr><td>Sun: 10:00 AM – 7:00 PM</td></tr>
</p>
</body>
</html>
Filename: contact.html
<html>
<head>
<title> Contact Details </title>
<body>
<h3 style="color:blue"> contact details </h3>
<p> contact no: 8787673768<br>
address: kr puram<br>
</body>
</html>
Filename: services.html
<html>
<head>
<title> services </title>
</head>
<body>
<h1> SERVICES PROVIDED </h1>
<ul>
<li> Professional Customer Service</li>
<li> High-Quality Refurbishes Laptops</li>
<li> Laptop Repair Services</li>
<li> Laptop Spare Parts </li>
<li> Chip level Repairing </li>
<ul>
</body>
</html>
OUTPUT SCREEN 1:
OUTPUT SCREEN 4:
5. Write an HTML code to create a login form. On submitting the form, the user should
get navigated to a profile page.
Filename : pg5.html
<html>
<head>
<title> Login Page </title>
<style>
Body
{
font-family: Calibri, Helvetica, sans-serif;
}
button
{
background-color: blue;
width: 10%;
color: orange;
<!padding: 5px; >
<!margin: 100px 10px; >
}
input[type=text], input[type=password]
{
width: 90%;
margin: 10px 0;
padding: 15px 20px;
}
</style>
</head>
<body>
<center> <h1> Student Login Form </h1> </center>
<form>
<label>Username : </label>
<input type="text" placeholder="Enter Username" name="username" required>
<label>Password : </label>
<input type="password" placeholder="Enter Password" name="password" required>
<br>
<input type="checkbox" checked="checked"> Remember me <br>
<button type="submit"> <a href="myprofile.html"> Login</a></button>
</form>
</body>
</html>
Filename : myprofile.html
<html>
<head>
<title> My profile </title>
</head>
<body>
<h1> MY PROFILE </h1>
<h3> Name : Student 1</h3>
<p> <b> Birthday: </b> ddmmyyyy </p>
<p> <b> Gender: </b> Male </p>
<p> <b> Email: </b> seacet@gmail.com </p>
<p> <b> Phone: </b> 1234567899 </p>
OUTPUT SCREEN 1:
OUTPUT SCREEN 2:
6. Write an HTML code to create a frameset having header, navigation and content
sections.
Filename : p6.html
<html>
<head>
<title>Frame tag</title>
</head>
<frameset rows="25%,50%,25%">
<frame src="frame1.html" >
<frame src="frame2.html">
<frame src="frame3.html">
</frameset>
</html>
Filename : frame1.html
<html>
<head>
<style>
div{
background-color: white;
height: 500px;
}
</style>
</head>
<body>
<div>
<h2>This is first frame</h2>
</div>
</body>
</html>
Filename : frame2.html
<html>
<head>
<style>
div{
background-color: #2f4f4f;
height: 500px;
}
</style>
</head>
<body>
<div>
<h2>This is Second frame</h2>
</div>
</body>
</html>
Filename : frame3.html
<html>
<head>
<style>
div{
background-color: #c1ffc1;
height: 500px;
}
</style>
</head>
<body>
<div>
<h2>This is Third frame</h2>
</div>
</body>
</html>
OUTPUT :
<html>
<head>
<title>Inline CSS</title>
</head>
<body style="background-color: bisque">
<h1 style="color:blue;">A Blue Heading</h1>
<p style="background:yellow" >HTML is used to structure a web page and its content.</p>
</body>
</html>
OUTPUT:
8. Write a Java script to prompt for users name and display it on the screen.
<html>
<head>
<script>
function myFunction()
{
let person = prompt("Please enter your name", "Harry Potter");
if (person != null)
{
document.getElementById("demo").innerHTML =
"Hello " + person + "! How are you today?";
}
}
</script>
</head>
<body>
OUTPUT SCREEN 1:
OUTPUT SCREEN 2:
OUTPUT SCREEN 3:
9. Design HTML form for keeping student record and validate it using Java script
<html>
<head>
<title>Student Record Form</title>
</head>
<body>
<h1>Student Record Form</h1>
<form id="studentForm">
<label for="name">Name:</label>
<input type="text" id="name" required>
<br>
<label for="age">Age:</label>
<input type="number" id="age" required>
<br>
<label for="email">Email:</label>
<input type="email" id="email" required>
<br>
<button type="submit">Submit</button>
</form>
<script>
document.getElementById("studentForm").addEventListener("submit", function(event)
{
event.preventDefault();
// Basic validation
if (name.trim() === "" || rollNumber.trim() === "" || age.trim() === "" || email.trim()
=== "") {
alert("All fields are required!");
return;
}
// Display the student record (you can do other operations with the data here)
alert(`Student Record:
Name: ${name}
Roll Number: ${rollNumber}
Age: ${age}
Email: ${email}`);
OUTPUT SCREEN 1:
OUTPUT SCREEN 2:
OUTPUT SCREEN 2:
10. Write a HTML code to list array elements using Java Script.
<html>
<body>
<center>
<h1>S.E.A College of Engineering</h1>
</center>
<ul id="myList"></ul>
<script>
let data = ["Ram", "Shyam", "Sita", "Gita"];
let list = document.getElementById("myList");
for (i = 0; i < data.length; ++i) {
let li = document.createElement('li');
li.innerText = data[i];
list.appendChild(li);
}
</script>
</body>
</html>