Day 3 Assignment PDF
Day 3 Assignment PDF
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form with All Input Control Elements</title>
</head>
<body>
<form>
<!-- Text Input -->
<label for="text_input">Text Input:</label>
<input type="text" id="text_input" class="input_class" name="text_input" placeholder="Enter
text..." autocomplete="on" readonly="false" required autofocus>
</body>
</html>
2Q)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fieldset and Legend Example</title>
</head>
<body>
<form>
<fieldset>
<legend>Contact Information</legend>
<label for="name">Name:</label>
<input type="text" id="name" name="name"><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>
<label for="message">Message:</label><br>
<textarea id="message" name="message" rows="4" cols="50"></textarea><br><br>
</fieldset>
<br>
<input type="submit" value="Submit">
</form>
</body>
</html>
3Q)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Input Field Validation</title>
<script>
function validateInput() {
var inputField = document.getElementById("inputField");
var minLength = inputField.getAttribute("minlength");
var maxLength = inputField.getAttribute("maxlength");
var inputValue = inputField.value.trim();
return true;
}
</script>
</head>
<body>
<form onsubmit="return validateInput()">
<label for="inputField">Input:</label>
<input type="text" id="inputField" name="inputField" minlength="3" maxlength="10" required>
<button type="submit">Submit</button>
</form>
</body>
</html>
4Q)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>File Upload</title>
</head>
<body>
<h2>Upload a File</h2>
<form action="/upload" method="post" enctype="multipart/form-data">
<input type="file" name="fileToUpload" id="fileToUpload">
<input type="submit" value="Upload File" name="submit">
</form>
</body>
</html>
5Q)
<!DOCTYPE html>
<html>
<head>
<title>Submit vs Button</title>
</head>
<body>
<form action="/submit_form" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username"><br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password"><br><br>
<!-- Submit button -->
<input type="submit" value="Submit">
<!-- Regular button -->
<button type="button" onclick="alert('Button clicked!')">Click
Me</button>
</form>
</body>
</html>
6Q)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML5 Input Elements</title>
</head>
<body>
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br>
<label for="number">Number:</label>
<input type="number" id="number" name="number"><br>
<label for="range">Range:</label>
<input type="range" id="range" name="range"><br>
<label for="search">Search:</label>
<input type="search" id="search" name="search"><br>
<label for="image">Image:</label>
<input type="image" id="image" src="example.jpg" alt="Submit"><br>
<label for="week">Week:</label>
<input type="week" id="week" name="week"><br>
<label for="url">URL:</label>
<input type="url" id="url" name="url"><br>
<label for="month">Month:</label>
<input type="month" id="month" name="month"><br>
<label for="datetime">Datetime-local:</label>
<input type="datetime-local" id="datetime" name="datetime"><br>
<label for="time">Time:</label>
<input type="time" id="time" name="time"><br>
<label for="date">Date:</label>
<input type="date" id="date" name="date"><br>
</body>
</html>
7Q)
8Q)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Student Form</title>
</head>
<body>
<h2>Student Information Form</h2>
<form action="/submit" method="post">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name"><br>
<label for="age">Age:</label><br>
<input type="number" id="age" name="age"><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email"><br>
<label for="gender">Gender:</label><br>
<select id="gender" name="gender">
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select><br>
<label for="major">Major:</label><br>
<input type="text" id="major" name="major"><br>
<label for="year">Year:</label><br>
<input type="number" id="year" name="year"><br>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Progress Bar</title>
<style>
.progress-container {
width: 50%;
margin: 50px auto;
border: 1px solid #ccc;
background-color: #f5f5f5;
border-radius: 5px;
padding: 5px;
}
.progress-bar {
width: 0%;
height: 30px;
background-color: #4caf50;
border-radius: 5px;
}
</style>
</head>
<body>
<div class="progress-container">
<div class="progress-bar" id="myBar"></div>
</div>
<script>
function move() {
var elem = document.getElementById("myBar");
var width = 0;
var id = setInterval(frame, 10);
function frame() {
if (width >= 100) {
clearInterval(id);
} else {
width++;
elem.style.width = width + '%';
}
}
}
// You can call the move() function to start the progress bar
// Example: move();
</script>
</body>
</html>
10Q)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Multiple Selection Dropdown</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="dropdown">
<button onclick="toggleDropdown()" class="dropbtn">Select items</button>
<div id="myDropdown" class="dropdown-content">
<input type="checkbox" id="item1" value="Item 1">
<label for="item1">Item 1</label><br>
<input type="checkbox" id="item2" value="Item 2">
<label for="item2">Item 2</label><br>
<input type="checkbox" id="item3" value="Item 3">
<label for="item3">Item 3</label><br>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
11Q)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DataList Tag Example</title>
</head>
<body>
<label for="browser">Choose a browser:</label>
<input list="browsers" id="browser" name="browser">
<datalist id="browsers">
<option value="Chrome">
<option value="Firefox">
<option value="Safari">
<option value="Edge">
<option value="Opera">
</datalist>
</body>
</html>