-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.js
34 lines (29 loc) · 930 Bytes
/
signup.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
let answers = document.querySelectorAll(".a");
answers.forEach((even) => {
even.addEventListener('click', () => {
if (even.classList.contains("active")) {
even.classList.remove("active");
}
else {
even.classList.add("active");
}
})
});
document.querySelector("form").addEventListener("submit", changePath)
var userData = JSON.parse(localStorage.getItem("UserData")) || [];
function changePath(event) {
event.preventDefault()
var email = document.querySelector("#email").value
var zip = document.querySelector("#zip").value
var pass = document.querySelector("#pass").value
var obj = {
Email: email,
Zip: zip,
Pass: pass
}
userData.push(obj);
alert("Sign in Successfully")
localStorage.setItem("UserData", JSON.stringify(userData))
window.location.href = "/plans/p.html"
console.log(userData)
}