WD
WD
WD LAB FILE
1
2
Index
S.No. Experiment Title Page Date Sign
No.
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<label for="name">Name:</label>
<label for="email">Email:</label>
<button type="submit">Submit</button>
</form>
JAVASCRIPT
<script>
function validateForm() {
document.getElementById("nameError").textContent = "";
document.getElementById("emailError").textContent = "";
document.getElementById("phoneError").textContent = "";
isValid = false;
if (!emailPattern.test(email)) {
isValid = false;
if (!phonePattern.test(phone)) {
isValid = false
}
return isValid;
</script>
</body>
</html>
CSS
body {
text-align: center;
padding: 50px;
form {
width: 350px;
margin: 0 auto;
padding: 20px;
border-radius: 5px;
background-color: #f9f9f9;
input {
width: 100%;
padding: 10px;
margin: 10px 0;
font-size: 1.2em
button {
width: 100%;
padding: 10px;
font-size: 1.2em;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
button:hover {
background-color: #45a049;
label{
font-size: 1.2em;
.error {
color: red;
font-size: 0.9em;
margin-top: 5px;
}
PRACTICAL-2
2. Create a Simple Web Page
Web Page
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Online Storefront</title>
<link rel="stylesheet" href="store.css">
</head>
<body>
<header>
<h1>My Online Store</h1>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#products">Products</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<section id="hero">
<h2>Welcome to the Best Online Store!</h2>
<p>Discover our range of products</p>
<a href="#products" class="cta-button">Shop Now</a>
</section>
<section id="products">
<h2 class="our">Our Products</h2>
<div class="product">
<img src="product1.jpg" alt="Product 1">
<h3>Girls Shoes</h3>
<p>price. 1000</p>
<button>Add to Cart</button>
</div>
<div class="product">
<img src="product2.jpg" alt="Product 2">
<h3>Girls Smart watch</h3>
<p>price. 2000</p>
<button>Add to Cart</button>
</div>
<div class="product">
<img src="product4.jpg" alt="Product 3">
<h3>Girls Top Frock</h3>
<p>price. 1200</p>
<button>Add to Cart</button>
</div>
</section>
</div>
</div>
<section id="about">
<h2>About Us</h2>
<p>Discover why millions of entrepreneurs chose Shopify to build their business — from hello
world to IPO.</p>
</section>
<footer>
<p>© 2024 My Online Store. All rights reserved.</p>
</footer>
</body>
</html>
CSS
body {
font-family: Arial;
margin: 0;
padding: 0;
background-color: #f8f8f8;
}
header {
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
}
nav ul {
list-style: none;
display: flex;
justify-content: center;
gap: 20px;
}
nav a {
color: #fff;
text-decoration: none;
padding: 10px 20px;
border-radius: 5px;
transition: background-color 0.3s;
}
nav a:hover {
background-color: #555;
}
#hero {
padding: 50px;
background-color: #e0e0e0;
text-align: center;
}
#hero h2 {
font-size: 2.5em;
margin-bottom: 10px;
}
.cta-button {
padding: 10px 20px;
background-color: #333;
color: #fff;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s;
}
.cta-button:hover {
background-color: #555;
}
.our {
text-align: center;
justify-content: center;
font-size: 30px;
}
#products {
padding: 40px;
display: flex;
justify-content: space-around;
text-align: center;
flex-wrap: wrap;
gap: 10px;
.product {
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
text-align: center;
.product img {
width: 100%;
height: 344px;
margin-bottom: 10px;
}
button {
padding: 10px 20px;
background-color: #333;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #555;
}
.shop-section {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
background-color: #e2e7e6;
}
.box {
height: 450px;
width: 23%;
background-color: white;
padding: 20px 0px 15px;
margin-top: 15px;
}
.box-img {
height: 300px;
background-size: cover;
margin-top: 1rem;
margin-bottom: 1rem;
}
.box-content
{
margin-left: 1rem;
margin-right: 1rem;
.box-content button
{
color: #fff;
display: flex;
justify-content: space-evenly;
text-align: center;
margin: auto;
}
.box-content button:hover {
background-color: #555;
footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 10px;
}
PRACTICAL-3
Description: Create a table that displays a list of products. Each row should include the product
name, description, price, and availability status (in-stock/out of stock). Use the <table>, <tr>, <th>,
and <td> tags.
o Include headers for each column (e.g., Product, Description, Price, Availability).
o Add at least five products with different information in each column.
o Ensure the table has a simple and clear design (you can use inline CSS for basic styling if
required).
Skills Tested: Using tables, rows, and cells in HTML, creating headers for tables.
Table for a Product List
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h2>Product List</h2>
<table>
<thead>
<tr>
<th>Product</th>
<th>Description</th>
<th>Price</th>
<th>Availability</th>
</tr>
</thead>
<tbody>
<tr>
<td>Wireless Mouse</td>
<td>A sleek, ergonomic wireless mouse with adjustable DPI settings.</td>
<td>₹500</td>
<td>In-stock</td>
</tr>
<tr>
<td>Bluetooth Headphones</td>
<td>Noise-canceling headphones with long-lasting battery life.</td>
<td>₹3000</td>
<td>Out of stock</td>
</tr>
<tr>
<td>Smartphone Charger</td>
<td>Fast-charging USB-C charger with universal compatibility.</td>
<td>₹1000</td>
<td>In-stock</td>
</tr>
<tr>
<td>Monitor</td>
<td>High-definition monitor with vivid colors and adjustable stand.</td>
<td>₹8000</td>
<td>In-stock</td>
</tr>
<tr>
<td>Gaming Keyboard</td>
<td>RGB mechanical keyboard with customizable keys.</td>
<td>₹9000</td>
<td>In-stock</td>
</tr>
</tbody>
</table>
</body>
</html>
CSS
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
font-family: Arial, sans-serif;
}
th, td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}
th {
background-color: #f2f2f2;
color: #333;
}
td {
background-color: #fff;
}
h2{
text-align: center;
}
PRACTICAL-4
4. Create an Ordered and Unordered List
<!DOCTYPE html>
<html lang="en">
<head>
<title>Favorite Things and Task Steps</title>
</head>
<body>
</body>
</html>
PRACTICAL-5
Description: Create a horizontal navigation bar that contains the following links:
o Home
o About Us
o Services
o Contact
Make sure that the navigation links are styled (using inline or internal CSS) so that they appear
horizontally and have a hover effect (e.g., change color when hovered).
Skills Tested: Creating links, working with navigation bars, basic CSS for styling (if needed).
Navigation Bar
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Navigation Bar</title>
<link rel="stylesheet" href="home.css">
</head>
<body>
<div class="nav">
<a href="#home">Home</a>
<a href="#about">About Us</a>
<a href="#services">Services</a>
<a href="#contact">Contact</a>
</div>
</body>
</html>
CSS
.nav {
background-color: #333;
overflow: hidden;
height: 80px;
}
body {
background-color: #ddd;
}
.nav a {
float: left;
display: block;
color: white;
text-align: center;
padding: 14px 20px;
text-decoration: none;
margin-left: 70px;
}
.nav a:hover {
background-color: #ddd;
color: black;
}
PRACTICAL-6
Description: Create a simple resume page that contains the following sections:
o A personal information section (name, contact details).
o An education section with the names of institutions, years attended, and degrees earned.
o A work experience section with job titles, companies, and employment dates.
o Use semantic HTML elements where possible, such as <section>, <article>, <header>,
<footer>, and <ul>.
Skills Tested: Resume formatting with HTML, using semantic tags, creating structured content.
Resume
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Resume</title>
<link rel="stylesheet" href="resume.css">
</head>
<body>
<header>
<h1>Amna Khatoon </h1>
<p class="contact">Email: [email protected] | Phone: 7858023095</p>
</header>
<section>
<h2>Personal Information</h2>
<ul>
<li>Name: Amna Khatoon</li>
<li>Email: [email protected]</li>
<li>Phone: 7858023095</li>
</ul>
</section>
<section>
<h2>Education</h2>
<ul class="education">
<li><strong>University of Jamia Millia Islamia</strong> - Undergraduade of Science in Computer
Science (2021 - 2023)</li>
<li><strong>College of Mangalmay institute of Engineering & Technology</strong> - Bachelor of
Science in Computer Science (2024 - 2027)</li>
<li><strong>Bihar Board High School</strong> - 10th Board (2020)</li>
</ul>
</section>
<section>
<h2>Work Experience</h2>
<ul class="experience">
<li><strong>Software Engineer</strong> - Tech Company Inc. (2024 - Present)</li>
<li><strong>Intern</strong> - Web Solutions Ltd. (2024 - 2025)</li>
</ul>
</section>
<section>
<h2>Skills</h2>
<ul class="skills">
<li>JavaScript</li>
<li>Python</li>
<li>React</li>
<li>SQL</li>
<li>Html</li>
<li>CSS</li>
<li>Problem-solving</li>
</ul>
</section>
</body>
</html>
CSS
body {
font-family: Arial, sans-serif;
margin: 40px;
line-height: 1.6;
}
header {
text-align: center;
margin-bottom: 30px;
}
h1 {
font-size: 2.5em;
margin-bottom: 10px;
}
.contact {
font-size: 1.2em;
}
section {
margin-bottom: 30px;
}
h2 {
color: #333;
border-bottom: 2px solid #333;
padding-bottom: 5px;
}
.experience, .education, .skills {
list-style-type: none;
padding: 0;
}
.experience li, .education li {
margin-bottom: 10px;
}
footer {
text-align: center;
font-size: 0.9em;
color: #777;
margin-top: 30px;
}
PRACTICAL-7
7. Simple Calculator
Description: Create a simple calculator using JavaScript that performs basic arithmetic
operations (addition, subtraction, multiplication, division). The calculator should have:
o Number buttons (0-9).
o Operation buttons (+, -, *, /).
o A display screen that shows the current value.
o A button to clear the display.
o The calculator should update the display as numbers and operations are clicked.
Skills Tested: DOM manipulation, event handling, basic JavaScript operations.
Simple Calculator
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Calculator </title>
<link rel="stylesheet" href="calcu.css">
</head>
<body>
<h1>Calculator</h1>
<div id="calculator">
<input type="text" id="display" readonly>
<div class="button_container">
<button class="button" onclick="currentDisplay = '';
document.querySelector('#display').value = currentDisplay;">c</button>
<script>
let currentDisplay = '';
document.querySelector('#display').value = currentDisplay;
</script>
</body>
</html>
CSS
*{
padding: 0;
margin: 0;
}
body {
background-color: #424242;
font-family: Tahoma;
}
h1 {
color: #FFF;
text-align: center;
margin-top: 2px;
margin-bottom: 5px;
}
#calculator {
border: 1px solid rgb(197, 183, 183);
border-radius: 5px;
width: 300px;
margin: auto;
}
#display {
margin: 10px;
width: 85%;
font-size: 25px;
background-color: #FFF;
.button {
width: 70px;
height: 70px;
margin: 3px;
}
.button_container {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
PRACTICAL-8
8. Palindrome Checker
Description: Create a function that checks if a given word or phrase is a palindrome. The
function should:
o Accept user input (a string).
o Ignore spaces, punctuation, and case sensitivity.
o Return true if the input is a palindrome, and false otherwise.
o Display the result on the webpage (e.g., "Yes, it's a palindrome!" or "No, it's not a
palindrome!").
Skills Tested: Strings, loops, conditionals.
Palindrome Checker
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<title>Palindrome Checker</title>
</head>
<body>
<h1>Palindrome Checker</h1>
<p>Enter a word or phrase to check if it's a palindrome:</p>
<script>
function checkPalindrome() {
let input = document.getElementById("inputText").value;
</body>
</html>
PRACTICAL 9
<!DOCTYPE html>
<html lang="en">
<head>
<title>Stylish Form</title>
<link rel="stylesheet" href="form.css">
</head>
<body>
<div class="form-container">
<h2>Contact Us</h2>
<form action="#">
<div class="form-group">
<label for="full-name">Full Name</label>
<input type="text" id="full-name" name="full-name" placeholder="Your full name">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" placeholder="Your email address">
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea id="message" name="message" placeholder="Your message"></textarea>
</div>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>
CSS
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.form-container {
background-color: #fff;
padding: 30px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 500px;
}
h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
}
label {
font-size: 1.1em;
margin-bottom: 8px;
display: block;
color: #555;
}
button {
width: 100%;
padding: 12px;
background-color: #007bff;
color: white;
font-size: 1.1em;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s, transform 0.2s;
}
button:hover {
background-color: #0056b3;
transform: scale(1.05);
}
button:active {
background-color: #00408d;
}
.form-group {
margin-bottom: 15px;
}
PRACTICAL-10
<!DOCTYPE html>
<html lang="en">
<head>
<title>Web Page with Embedded Media</title>
<link rel="stylesheet" href="media.css">
</head>
<body>
<div class="content">
<h1>Welcome to My Web Page</h1>
<p>Enjoy the following media content:</p>
<div class="media-container">
<h2>Embedded YouTube Video</h2>
<iframe width="420" height="345" src="https://www.youtube.com/embed/tgbNymZ7vqY">
</iframe>
</div>
<div class="media-container">
<h2>Embedded Audio</h2>
<audio controls>
<source src="https://www.example.com/audio.mp3" type="audio/mp3">
Your browser does not support the audio element.
</audio>
</div>
</div>
</body>
</html>
CSS
body {
margin: 0;
padding: 0;
background-image: url('https://www.example.com/your-image.jpg');
background-size: cover;
background-position: center;
background-attachment: fixed;
color: white;
font-family: Arial, sans-serif;
}
.content {
text-align: center;
padding: 50px;
background: rgba(0, 0, 0, 0.5);
}
h1 {
font-size: 2.5em;
margin-bottom: 20px;
}
.media-container {
margin: 30px 0;
}
iframe {
width: 100%;
max-width: 800px;
height: 450px;
}
audio {
margin-top: 20px;
}