-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
37 lines (21 loc) · 942 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
28
29
30
31
32
33
34
35
36
37
document.addEventListener('DOMContentLoaded', function () {
const questions = document.querySelectorAll('.faq-question');
questions.forEach(question => {
question.addEventListener('click', function () {
const answer = this.nextElementSibling;
const icon = this.querySelector('.icon');
answer.style.display = answer.style.display === 'none' ? 'block' : 'none';
icon.textContent = icon.textContent === '+' ? '×' : '+';
});
});
document.getElementById("myForm").addEventListener("submit", function (event) {
event.preventDefault();
var emailValue = document.getElementById("email").value;
var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(emailValue)) {
alert("Please enter a valid email address.");
return;
}
window.location.href = "test.html";
});
});