-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
46 lines (33 loc) · 1.48 KB
/
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
38
39
40
41
42
43
44
45
46
let subscribeSection = document.getElementById("subscribe-section");
let contactSection = document.getElementById('contact-section');
const menu = document.getElementById("menu-option");
function hideMenu() {
menu.style.right = "-80%";
}
function showMenu() {
menu.style.right = "0";
console.log("Show menu!");
}
handleSubscribe = (e) => {
e.preventDefault();
//add email string in email input to newsletter database
//remove the form in the subscribe section
//update the p element in subscribe section
let updatedString = "Thank you for subscribing to our newsletter where you will recieve the latest trends, techniques and information about marketing success.";
let newElement = document.createElement('p');
newElement.textContent = updatedString;
newElement.setAttribute('class', 'subscribed');
subscribeSection.innerHTML = "";
subscribeSection.appendChild(newElement);
};
handleSubmit = (e) => {
e.preventDefault();
//handle each form input so that marketing team can reach out to contact
//remove form and thank client for reaching out
let updatedString = "Thank you for reaching out to Marketing Media, Inc. We have received your information and look forward to connecting within two business days.";
let newElement = document.createElement('p');
newElement.textContent = updatedString;
newElement.setAttribute('class', 'subscribed');
contactSection.innerHTML = "";
contactSection.appendChild(newElement);
}