Web Technology 1
Web Technology 1
1.
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My College</title>
</head>
<body>
<h1>My College</h1>
<h2>Departments</h2>
<ul>
<li><a href="electronics.html">Electronics</a></li>
</ul>
</body>
</html>
<html>
<head>
<title>Class Timetable</title>
<style>
th { background-color: #f2f2f2; }
</style>
</head>
<body>
<h2>Class Timetable</h2>
<table>
<tr>
<th>Day</th><th>9-10</th><th>10-11</th><th>11-12</th><th>12-1</th><th>Lunch</
th><th>2-3</th><th>3-4</th>
</tr>
<tr>
<td>Mon</td><td>Math</td><td>Sci</td><td>Eng</td><td>Hist</td><td
rowspan="6">Break</td><td>Phy</td><td>Comp</td>
</tr>
<tr>
<td>Tue</td><td>Eng</td><td>Math</td><td>Phy</td><td>Sci</td><td>Hist</
td><td>Sports</td>
</tr>
<tr>
<td>Wed</td><td>Sci</td><td>Comp</td><td>Eng</td><td>Math</td><td>Hist</
td><td>Phy</td>
</tr>
</table>
</body>
</html>
3. Write a HTML code to design Student registrations form for your college Admission
<!DOCTYPE html>
<html>
<head>
<title>Student Registration</title>
<style>
form { width: 50%; margin: auto; padding: 20px; border: 1px solid #ccc; background:
#f9f9f9; }
button { margin-top: 10px; padding: 10px; background: #28a745; color: white; border:
none; }
</style>
</head>
<body>
<form>
<select><option>Male</option><option>Female</option><option>Other</option></
select>
<select><option>B.Sc</option><option>B.Com</option><option>B.A</option><option>B.Te
ch</option></select>
<button type="submit">Submit</button>
</form>
</body>
</html>
<meta charset="UTF-8">
<title>Multimedia Page</title>
<style>
</style>
</head>
<body>
<div class="container">
<h2>Multimedia Showcase</h2>
<img src="https://media.giphy.com/media/26AHONQ79FdWZhAI0/giphy.gif"
alt="GIF">
</div>
</body>
</html>
.column {
flex: 1;
}
.top-left {
background-color: #FF6666; /* Red */
}
.top-right {
background-color: #66B2FF; /* Blue */
}
.bottom-left {
background-color: #66FF66; /* Green */
}
.bottom-right {
background-color: #FFFF66; /* Yellow */
}
</style>
</head>
<body>
<div class="row">
<div class="column top-left"></div>
<div class="column top-right"></div>
</div>
<div class="row">
<div class="column bottom-left"></div>
<div class="column bottom-right"></div>
</div>
</body>
</html>
7. Write CSS code to Use Inline CSS to format your ID Card.
<!DOCTYPE html>
<html>
<head>
<title>ID Card</title>
</head>
<body>
<div style="width: 300px; height: 180px; border: 2px solid #000; padding:
10px; font-family: Arial, sans-serif; background-color: #f2f2f2; border-radius:
10px; text-align: center;">
</div>
</body>
</html>
8. Using HTML, CSS create display a text called ―Hello India !ǁ on top of an
image of India-Map using an overlay.
<!DOCTYPE html>
<html>
<head>
<title>Hello India Overlay</title>
</head>
<body>
</body>
</html>
PART-B
1. Write a JavaScript Program to perform Basic Arithmetic operations
<!DOCTYPE html>
<html>
<head>
<title>Arithmetic Operations</title>
</head>
<body>
<button onclick="calculate()">Calculate</button>
<h3>Results:</h3>
<p id="add"></p>
<p id="sub"></p>
<p id="mul"></p>
<p id="div"></p>
<script>
function calculate() {
var a = parseFloat(document.getElementById("num1").value);
var b = parseFloat(document.getElementById("num2").value);
if (b !== 0) {
document.getElementById("div").innerHTML = "Division: " + (a / b);
} else {
document.getElementById("div").innerHTML = "Division: Cannot
divide by zero";
}
}
</script>
</body>
</html>
2. JavaScript Program to Check Prime Number
<!DOCTYPE html>
<html>
<head>
<title>Prime Number Checker</title>
</head>
<body>
<h3 id="result"></h3>
<script>
function checkPrime() {
let num = parseInt(document.getElementById("numberInput").value);
let isPrime = true;
if (num <= 1) {
isPrime = false;
} else {
for (let i = 2; i <= Math.sqrt(num); i++) {
if (num % i === 0) {
isPrime = false;
break;
}
}
}
if (isPrime) {
document.getElementById("result").innerHTML = num + " is a Prime
Number.";
} else {
document.getElementById("result").innerHTML = num + " is NOT a
Prime Number.";
}
}
</script>
</body>
</html>
3.JavaScript Program to implement JavaScript Object Concept
<!DOCTYPE html>
<html>
<head>
<title>JavaScript Object Example</title>
</head>
<body>
<script>
// Create a JavaScript object
var student = {
name: "Aarav",
age: 21,
course: "Computer Science",
display: function() {
return `Name: ${this.name} <br> Age: ${this.age} <br> Course: $
{this.course}`;
}
};
</body>
</html>
4. JavaScript Program to Create Array and inserting Data into Array
<!DOCTYPE html>
<html>
<head>
<title>Array Example</title>
</head>
<body>
<h3>Array Contents:</h3>
<p id="output"></p>
<script>
// Create an empty array
let myArray = [];
</body>
</html>
5. JavaScript Program to Validate an Email Address
<!DOCTYPE html>
<html>
<head>
<title>Email Validation</title>
</head>
<body>
<h2>Email Validator</h2>
<script>
function validateEmail() {
var email = document.getElementById("email").value;
if (pattern.test(email)) {
document.getElementById("result").innerHTML = "✅ Valid Email
Address";
document.getElementById("result").style.color = "green";
} else {
document.getElementById("result").innerHTML = "❌ Invalid Email
Address";
document.getElementById("result").style.color = "red";
}
}
</script>
</body>
</html>