Interactive Website Prototype JavaScript, HTML, CSS
👤 Sharing: AI
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Interactive Website Prototype</title>
<style>
body {
font-family: sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
header {
background-color: #333;
color: #fff;
padding: 10px 0;
text-align: center;
}
nav {
background-color: #444;
color: #fff;
padding: 10px 0;
text-align: center;
}
nav a {
color: #fff;
text-decoration: none;
padding: 10px 20px;
}
nav a:hover {
background-color: #555;
}
main {
padding: 20px;
}
section {
margin-bottom: 20px;
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
footer {
background-color: #333;
color: #fff;
text-align: center;
padding: 10px 0;
position: fixed;
bottom: 0;
width: 100%;
}
.button {
background-color: #4CAF50;
border: none;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
}
.button:hover {
background-color: #3e8e41;
}
#dynamicContent {
margin-top: 20px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
</style>
</head>
<body>
<header>
<h1>Interactive Website Prototype</h1>
</header>
<nav>
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Services</a>
<a href="#">Contact</a>
</nav>
<main>
<section id="home">
<h2>Welcome to the Home Page</h2>
<p>This is a simple interactive website prototype using HTML, CSS, and JavaScript.</p>
<button class="button" onclick="showAlert()">Click Me!</button>
<div id="dynamicContent">
<p>This content will be updated dynamically.</p>
</div>
<button class="button" onclick="updateContent()">Update Content</button>
</section>
<section id="about">
<h2>About Us</h2>
<p>Learn more about our company and our mission.</p>
</section>
<section id="services">
<h2>Our Services</h2>
<ul>
<li>Web Development</li>
<li>Graphic Design</li>
<li>Digital Marketing</li>
</ul>
</section>
<section id="contact">
<h2>Contact Us</h2>
<form id="contactForm">
<label for="name">Name:</label><br>
<input type="text" id="name" name="name"><br><br>
<label for="email">Email:</label><br>
<input type="email" id="email" name="email"><br><br>
<label for="message">Message:</label><br>
<textarea id="message" name="message"></textarea><br><br>
<button type="button" class="button" onclick="submitForm()">Submit</button>
</form>
</section>
</main>
<footer>
<p>© 2023 Interactive Website Prototype</p>
</footer>
<script>
function showAlert() {
alert("You clicked the button!");
}
function updateContent() {
document.getElementById("dynamicContent").innerHTML = "<p>Content has been dynamically updated using JavaScript!</p>";
}
function submitForm() {
const name = document.getElementById("name").value;
const email = document.getElementById("email").value;
const message = document.getElementById("message").value;
if (name === "" || email === "" || message === "") {
alert("Please fill in all fields.");
return;
}
alert("Form submitted!\nName: " + name + "\nEmail: " + email + "\nMessage: " + message);
// Optionally clear the form after submission
document.getElementById("contactForm").reset();
}
</script>
</body>
</html>
```
👁️ Viewed: 9
Comments