Advanced HTML & CSS
This commit is contained in:
65
Week-02/Day_02/index.html
Normal file
65
Week-02/Day_02/index.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Advanced HTML & CSS - Simple Form</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<nav class="nav">
|
||||
<ul>
|
||||
<li><a href="#about">About</a></li>
|
||||
<li><a href="#product">Product</a></li>
|
||||
<li><a href="#contact">Contact</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<div class="wrapper">
|
||||
|
||||
<form class="form" id="userForm">
|
||||
<h3>User Form</h3>
|
||||
|
||||
<input type="text" id="name" name="name" placeholder="Name" required>
|
||||
<input type="email" id="email" name="email" placeholder="Email" required>
|
||||
<input type="text" id="city" name="city" placeholder="City">
|
||||
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
|
||||
<div class="display">
|
||||
<h3>Entered Details</h3>
|
||||
<p>Name: <span id="displayName">______</span></p>
|
||||
<p>Email: <span id="displayEmail">______</span></p>
|
||||
<p>City: <span id="displayCity">______</span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="pagination">
|
||||
<a href="#" class="prev">«</a>
|
||||
<a href="#" class="page active">1</a>
|
||||
<a href="#" class="page">2</a>
|
||||
<a href="#" class="page">3</a>
|
||||
<a href="#" class="next">»</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
document.getElementById('userForm').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
var name = document.getElementById('name').value.trim();
|
||||
var email = document.getElementById('email').value.trim();
|
||||
var city = document.getElementById('city').value.trim();
|
||||
|
||||
document.getElementById('displayName').textContent = name || '______';
|
||||
document.getElementById('displayEmail').textContent = email || '______';
|
||||
document.getElementById('displayCity').textContent = city || '______';
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user