-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
36 lines (32 loc) · 940 Bytes
/
Copy pathscript.js
File metadata and controls
36 lines (32 loc) · 940 Bytes
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
28
29
30
31
32
33
34
35
36
// button counter
const ampButtons = document.querySelectorAll('.amp-btn');
ampButtons.forEach(button => {
button.addEventListener('click', () => {
const countSpan = button.previousElementSibling;
let count = parseInt(countSpan.textContent) || 0;
count++;
countSpan.textContent = `${count} AMPS`;
});
});
// removing join now button
const joinBtn = document.getElementById('btn-join');
if (joinBtn) {
joinBtn.addEventListener('click', () => {
joinBtn.remove();
});
}
// preorder button & email alert
const preorderForm = document.getElementById('join-now');
if (preorderForm) {
preorderForm.addEventListener('submit', (e) => {
e.preventDefault();
const emailInput = document.getElementById('email');
const email = emailInput.value.trim();
if (email) {
alert(`Preorder sent to ${email}`);
emailInput.value = "";
} else {
alert("Please enter your email.");
}
});
}