-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
35 lines (31 loc) · 914 Bytes
/
script.js
File metadata and controls
35 lines (31 loc) · 914 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
// TODO: Create toggleMenu()
function toggleMenu() {
const menu = document.querySelector(' .menu-links');
const icon = document.querySelector(' .hamburger.icon');
menu.classList.toggle('open')
icon.classList.toggle('open')
}
// TODO: Create sendEmail()
function sendEmail() {
var name = document.getElementById
value
var email = document.getElementById
value
var message = document.getElementById
("message").value;
email.send({
//Host doesn't work with gmail
Host: "smtp.gmail.com",
Username: "ysjin6251@gmail.com",
Password: "password",
To: "ysjin6251@gmail.com",
From: email,
Subject: "New Website Enquiry rom ${name}",
Body: message
}) .then(function(message){
// Reset form after successful submission
alert("Email sent successfully!")
})
}
}
// TODO: Create reset()