-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
27 lines (25 loc) · 956 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Display listings
function displayListings() {
listingsContainer.innerHTML = '';
listings.forEach(listing => {
const listingElement = document.createElement('div');
listingElement.classList.add('listing');
listingElement.innerHTML = `
<h3>${listing.title}</h3>
<p>${listing.description}</p>
<p>Price: $${listing.price}</p>
`;
listingsContainer.appendChild(listingElement);
});
}
// Handle form submission
signupForm.addEventListener('submit', (e) => {
e.preventDefault();
const email = document.getElementById('email').value;
const userType = document.getElementById('user-type').value;
alert(`Thank you for signing up! We'll contact you at ${email} as a ${userType}.`);
signupForm.reset();
});
// Initial display of listings
displayListings();
});