Page 309 - Web Applications (803) Class 12
P. 309
text-decoration: none;
color: #fff;
font-weight: bold;
}
main {
max-width: 800px;
margin: 0 auto;
padding: 2rem;
}
File6: Pscript.js
// Get form and success message elements from the DOM
const feedbackForm = document.getElementById(‘feedback-form’);
const feedbackSuccess = document.getElementById(‘feedback-success’);
// Event listener for the feedback form submission
feedbackForm.addEventListener(‘submit’, function (e) {
e.preventDefault();
// Collect user input
const name = document.getElementById(‘name’).value;
const email = document.getElementById(‘email’).value;
const message = document.getElementById(‘message’).value;
// In a real application, you would typically send this data to a server.
// For this example, we’ll just show a success message.
feedbackForm.style.display = ‘none’;
feedbackSuccess.style.display = ‘block’;
});
PROJECT 6
Simple digital clock using HTML, CSS and JavaScript
Projects 307

