Pavan
Pavan
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<form id="userForm">
<label for="name">Name:</label>
<label for="email">Email:</label>
<label>Gender:</label><br>
<label for="male">Male</label><br>
<label for="female">Female</label><br>
<label for="other">Other</label><br><br>
<label>Interests:</label><br>
<label for="reading">Reading</label><br>
<label for="traveling">Traveling</label><br>
<input type="checkbox" id="sports" name="interests" value="sports">
<label for="sports">Sports</label><br><br>
<button type="submit">Submit</button>
</form>
<script src="script.js"></script>
</body>
</html>
--------------------------------------------------------------------------------------------------------------------------------------
Styles.css
body {
margin: 40px;
label {
display: block;
margin-bottom: 5px;
input, textarea {
margin-bottom: 20px;
width: 100%;
padding: 10px;
box-sizing: border-box;
input[type="radio"], input[type="checkbox"] {
width: auto;
}
button {
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
button:hover {
background-color: #0056b3;
--------------------------------------------------------------------------------------------------------------------------------------
Script.js
--------------------------------------------------------------------------------------------------------------------------------------
document.getElementById('userForm').addEventListener('submit', function(event) {
event.preventDefault();
data.interests = formData.getAll('interests');
console.log(data);
});
2
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<form id="feedbackForm">
<label>Rating:</label><br>
<label for="feedback">Feedback:</label><br>
<label for="subscribe">
<input type="checkbox" id="subscribe" name="subscribe">
Subscribe to newsletter
</label><br><br>
<button type="submit">Submit</button>
</form>
<script src="script.js"></script>
</body>
</html>
Styles.css
body {
margin: 40px;
label {
display: block;
margin-bottom: 5px;
input, textarea {
margin-bottom: 20px;
width: 100%;
padding: 10px;
box-sizing: border-box;
input[type="radio"], input[type="checkbox"] {
width: auto;
button {
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
button:hover {
background-color: #0056b3;
script.js
document.getElementById('feedbackForm').addEventListener('submit', function(event) {
event.preventDefault();
console.log(data);
});
3
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<form id="registrationForm">
<label for="networking">Networking</label><br>
<label for="workshops">Workshops</label><br>
<input type="checkbox" id="keynotes" name="interests" value="keynotes">
<label for="keynotes">Keynotes</label><br><br>
<button type="submit">Submit</button>
</form>
<script src="script.js"></script>
</body>
</html>
Styles.css
body {
margin: 40px;
label {
display: block;
margin-bottom: 5px;
input, textarea {
margin-bottom: 20px;
width: 100%;
padding: 10px;
box-sizing: border-box;
input[type="radio"], input[type="checkbox"] {
width: auto;
button {
color: white;
border: none;
cursor: pointer;
button:hover {
background-color: #0056b3;
Script.js
document.getElementById('registrationForm').addEventListener('submit', function(event) {
event.preventDefault();
data.interests = formData.getAll('interests');
console.log(data);
});
4
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<form id="surveyForm">
<label for="excellent">Excellent</label><br>
<label for="good">Good</label><br>
<label for="fair">Fair</label><br>
<label for="poor">Poor</label><br><br>
<label for="terms">
<button type="submit">Submit</button>
</form>
<script src="script.js"></script>
</body>
</html>
Styles.css
body {
margin: 40px;
label {
display: block;
margin-bottom: 5px;
input, textarea {
margin-bottom: 20px;
width: 100%;
padding: 10px;
box-sizing: border-box;
input[type="radio"], input[type="checkbox"] {
width: auto;
button {
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
Script.js
document.getElementById('surveyForm').addEventListener('submit', function(event) {
event.preventDefault();
data.usability = formData.get('usability');
console.log(data);
});
5
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<form id="bookingForm">
<label>Room Type:</label><br>
<label for="single">Single</label><br>
<label for="double">Double</label><br>
<label for="suite">Suite</label><br><br>
<label>Add Extras:</label><br>
<button type="submit">Submit</button>
</form>
<script src="script.js"></script>
</body>
</html>
Styles.css
body {
margin: 40px;
label {
display: block;
margin-bottom: 5px;
input, textarea {
margin-bottom: 20px;
width: 100%;
padding: 10px;
box-sizing: border-box;
input[type="radio"], input[type="checkbox"] {
width: auto;
}
button {
background-color: #007BFF;
color: white;
border: none;
cursor: pointer;
button:hover {
background-color: #0056b3;
Script.js
document.getElementById('bookingForm').addEventListener('submit', function(event) {
event.preventDefault();
data.extras = formData.getAll('extras');
console.log(data);
});