-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
20 lines (18 loc) · 776 Bytes
/
script.js
File metadata and controls
20 lines (18 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
document.addEventListener('DOMContentLoaded', () => {
// Contact form submit
const contactForm = document.getElementById('contactForm');
if (contactForm) {
contactForm.addEventListener('submit', (e) => {
e.preventDefault();
const name = document.getElementById('name').value.trim();
const email = document.getElementById('email').value.trim();
const message = document.getElementById('message').value.trim();
if (name && email && message) {
alert(`Thanks for reaching out, ${name}! We'll be in touch soon.`);
contactForm.reset();
} else {
alert('Please fill out all fields.');
}
});
}
});