-
Notifications
You must be signed in to change notification settings - Fork 0
/
signUp.html
126 lines (102 loc) · 3.28 KB
/
signUp.html
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Signup</title>
<script
src="https://kit.fontawesome.com/f1eae3bf56.js"
crossorigin="anonymous"
></script>
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,500;1,200;1,400;1,500&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="styles/signUp.css">
<link rel="stylesheet" href="styles/navbar.css">
</head>
<body>
<header>
<div id="nav">
<div class="set1"><img src=".\image\samsungLogo.png" id="logo"></img></div>
<div class="set2">
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
<a href="#"></a>
</div>
<div class="set3">
<a href="#"</a>
<a href="#"></a>
<a href="#"></a>
</div>
<div class="set4">
<a href=""><img id="search" src=".\image\searchLogo.png" alt=""></a>
<div class="ca" style="display:inline-block"><a href="cart.html"><img src=".\image\cart.png" alt=""><div id="cartTick"></div></a></div>
<div class="dropdown">
<img src=".\image\login.jpg" alt="">
<div class="dropdown-content">
<p id="tag"></p>
<a href="signIn.html">Login</a>
<a href="signUp.html">Sign Up</a>
<a href="#">Log Out</a>
</div>
</div>
</div>
</div>
</header>
<div id="container">
<div class="box">
<div>
<h2> Signup your account</h2>
</div>
<div>
<form onsubmit="signup(event)" id="myForm">
<div>
<input type="text" id="nm" name="name" placeholder="name" value>
</div>
<div>
<input type="text" id="email" name="email" placeholder="Email" value>
</div>
<div>
<input type="password" id="pass" name="pass" placeholder="Password" value>
</div>
<div class="forgotPassword">
<button type="button" id="forgot_password_link">Forgot Password?</button>
</div>
<div id="d1">
<button id="login_password_submit" type="submit" >Sign up</button></a>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
<script>
function signup(e){
e.preventDefault();
let myForm = document.getElementById("myForm");
let name = document.getElementById("nm")
let email =document.getElementById("email");
let pass= document.getElementById("pass");
let Name=name.value
let Email =email.value;
let password= pass.value;
if(localStorage.getItem("users")===null){
localStorage.setItem("users", JSON.stringify([]))
}
let user={
Name,
Email,
password,
};
let arr= JSON.parse(localStorage.getItem("users"));
arr.push(user);
localStorage.setItem("users",JSON.stringify(arr));
location.href = "home.html"
}
</script>