forked from ritesh-2124/Himalaya-clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signUp.js
35 lines (26 loc) · 922 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
35
document.querySelector("#old").addEventListener("click" , myfunction)
var login_data = JSON.parse(localStorage.getItem("himalaya"))
function myfunction(){
var email = document.querySelector("#email").value;
var pass = document.querySelector("#pass").value;
if(email == "[email protected]" && pass == "adminpass"){
window.location.href="admin.html"
}
else{
login_data.map(function(elem){
if(elem.email== email && elem.pass == pass){
window.location.href = "landingpage.html"
}
})
}
}
document.querySelector("#new").addEventListener("click" , new_account)
function new_account(){
window.location.href= "creat_account.html"
}
document.querySelector("#cart").addEventListener("click" , function(){
window.location.href = "cartpage.html"
})
Document.querySelector("#old").addEventListener("click" , function(){
window.location.href="productPage.html"
})