Frontend assignment
Frontend assignment
Admission no :- 22SCSE1010982
1. (a)
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Lists Example</title>
</head>
<body>
<h2>Unordered List</h2>
<ul>
<li>Banana</li>
<li>Apple</li>
<li>Mango</li>
</ul>
<h2>Ordered List</h2>
<ol>
<li>Banana</li>
<li>Apple</li>
<li>Mango</li>
</ol>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Table Example</title>
</head>
<body>
<h2>Table Example</h2>
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
<tr>
<td>John</td>
<td>25</td>
<td>New York</td>
</tr>
<tr>
<td>Jane</td>
<td>30</td>
<td>London</td>
</tr>
</table>
</body>
</html>
(iii) *<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>Education Details</title>
</head>
<body>
<table border=”1”>
<tr>
<th>Degree</th>
<th>University</th>
<th>Year</th>
</tr>
<tr>
<td>Bachelor of Science</td>
<td>ABC University</td>
<td>2021</td>
</tr>
<tr>
<td>Master of Science</td>
<td>XYZ University</td>
<td>2023</td>
</tr>
</table>
</body>
</html>
(b)
• main.html
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>Home Page</title>
</head>
<body>
<ul>
</ul>
</body>
</html>
• about.html
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>About Us</title>
</head>
<body>
<h1>About Us</h1>
</body>
</html>
• Contact.html
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>Contact Us</title>
</head>
<body>
<h1>Contact Us</h1>
</body>
</html>
• services.html
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>Our Services</title>
</head>
<body>
<h1>Our Services</h1>
</html>
2.
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>Login Form</title>
</head>
<body>
<h2>Login</h2>
<form action=”profile.html” method=”POST”>
<label for=”username”>Username:</label>
<label for=”password”>Password:</label>
</form>
</body>
</html>
3.
(a)
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>Registration Form</title>
</head>
<body>
<h2>Registration</h2>
<label for=”username”>Username:</label>
<label for=”password”>Password:</label>
</form>
</body>
</html>
(b)
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
Body {
Display: flex;
Justify-content: center;
Align-items: center;
Height: 100vh;
Margin: 0;
Background-color: #f0f0f0;
.frame-container {
Display: flex;
Position: relative;
Iframe.frame1 {
Width: 150px;
Height: 100px;
Iframe.frame2 {
Width: 150px;
Height: 100px;
Position: relative;
Margin-left: 10px;
Iframe.frame3 {
Width: 150px;
Height: 100px;
Position: absolute;
Top: 0;
</style>
</head>
<body>
<div class=”frame-container”>
</div>
</body>
</html>
4.
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
</head>
<body>
<map name=”worldmap”>
</map>
<p>Click on different areas of the map to learn more about the continents.</p>
</body>
</html>
5.
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0”>
<script>
Function countText() {
</script>
</head>
<body>
<h2>Enter Text</h2>
<button onclick=”countText()”>Submit</button>
</body>
</html>
6. (a)
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>Styling Example</title>
<style>
Body {
Background-color: lightblue;
H1 {
Color: darkblue;
</style>
</head>
<body>
</body>
</html>
(b)
<html>
<head>
<script type=”text/javascript”>
<!—
Function validate_form ( )
Valid = true;
If ( document.contact_form.contact_name.value == “” )
Valid = false;
If ( document.contact_form.contact_name.value != “” )
Alert ( “Succesfull” );
Valid = false;
Return valid;
}//
</script>
</head>
<body bgcolor=”#FFFFFF”>
</form>
</body>
</html>
7.
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0”>
<style>
Body {
Background-image: url(‘background.jpg’);
Background-size: cover;
Color: #ffffff;
Margin: 0;
Padding: 0;
H1 {
Text-align: center;
P{
Font-size: 16px;
Line-height: 1.5;
Text-align: justify;
Margin: 20px;
}
.highlight {
Font-style: italic;
.box {
Width: 300px;
Height: 150px;
Color: white;
Padding: 20px;
Border-radius: 10px;
.button {
Color: white;
Border: none;
Border-radius: 5px;
Cursor: pointer;
.button:hover {
Background-color: #45a049;
}
</style>
</head>
<body>
<p>This page is styled using CSS. It uses various font styles and background images.</p>
<div class=”box”>
</div>
</body>
</html>
8.
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<script>
Function numberToWords() {
Const numWords = [
“zero”, “one”, “two”, “three”, “four”, “five”, “six”, “seven”, “eight”, “nine”
];
If (isNaN(num)) {
resultBox.value = “Not a number”;
} else {
Digits.forEach(digit => {
Words.push(numWords[parseInt(digit)]);
});
resultBox.value = words.join(‘-‘);
</script>
</head>
<body>
<button onclick=”numberToWords()”>Convert</button>
<br><br>
<label for=”result”>Result:</label>
</html>
G.
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>Shopping Cart</title>
<style>
Body {
.cart-item {
Margin: 10px;
Padding: 10px;
Border: 1px solid #ddd;
Width: 200px;
Display: inline-block;
Text-align: center;
.cart-item img {
Width: 100px;
Height: 100px;
.cart-item button {
Background-color: #4CAF50;
Color: white;
Padding: 10px;
Border: none;
Cursor: pointer;
.cart-item button:hover {
Background-color: #45a049;
#cart {
Margin-top: 20px;
}
</style>
<script>
displayCart();
Function displayCart() {
let total = 0;
cart.forEach(item => {
total += item.price;
});
</script>
</head>
<body>
<h1>Shopping Cart</h1>
<div class=”cart-item”>
<img
src=https://www.zorin.co.in/cdn/shop/products/ZRNOSTSilvo4830Walnut_1.jpg?v=168467
3726Cwidth=5472 alt=”Item 1”>
<h3>Item 1</h3>
<p>900</p>
</div>
<div class=”cart-item”>
<img src=https://images.pickawood.com/gfx/conf/tables/new/berlin-et-kernbuche-
natur-geoelt-swiss-legn.jpg alt=”Item 2”>
<h3>Item 2</h3>
<p>800</p>
</div>
<div id=”cart”></div>
</body>
</html>
10.
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<title>Registration Form</title>
<script>
Function validateForm() {
// Name validation
If (!/^[a-zA-Z]{6,}$/.test(name)) {
Return false;
// Password validation
If (password.length < 6) {
Return false;
// Email validation
If (!emailPattern.test(email)) {
Return false;
If (!/^\d{10}$/.test(phone)) {
Return false;
}
Alert(“Registration successful!”);
Return true;
</script>
</head>
<body>
<h1>Registration Form</h1>
<label for=”name”>Name:</label>
<label for=”password”>Password:</label>
<label for=”email”>Email:</label>
</form>
</body>
</html>
11.
Return (
<div>
<button onClick={increment}>Increase</button>
<button onClick={decrement}>Decrease</button>
</div>
);
};
12.
};
return (
<div>
<form onSubmit={handleSubmit}>
<label>
<input
type="text"
value={name}
/>
</label>
<button type="submit">Submit</button>
</form>
</div>
);
};
export default NameForm;