-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
47 lines (44 loc) · 1.24 KB
/
index.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
38
39
40
41
42
43
44
45
46
47
document.getElementById("showMenu").onclick = function () {
showMenu();
console.log("its okay");
};
function showMenu() {
var menuContainer = document.getElementById("menus");
if (menuContainer.style.display === "block") {
menuContainer.style.display = "none";
} else {
menuContainer.style.display = "block";
}
}
function sendEmail() {
Email.send({
Host: "smtp.elasticemail.com",
Username: "[email protected]",
Password: "2E0A6D2A4EEE5330CD1D7C87F7AF63E1CAC3",
To: "[email protected]",
From: document.getElementById("email").value,
Subject: "New Prerigestered",
Body:
"Name: " +
document.getElementById("name").value +
"<br> Email: " +
document.getElementById("email").value +
" <br> Message: " +
document.getElementById("message").value,
}).then((message) => alert(message));
hideForm();
}
function showForm() {
const formDiv = document.getElementById("formDiv");
formDiv.style.display = "block";
console.log("hello");
}
function hideForm() {
const formDiv = document.getElementById("formDiv");
if (document.getElementById("email") === null) {
console.log("not allowed");
} else {
formDiv.style.display = "none";
}
console.log("hello");
}