-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsign-up-page.html
64 lines (55 loc) · 1.53 KB
/
sign-up-page.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
<!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>Document</title>
<style>
#container{
width: 40%;
height: auto
;
margin: auto;
background-color: black;
color: white;
text-align: center;
}
#submit{
margin-top: 20px;
}
</style>
</head>
<body>
<div id="container">
<form action="" id="form">
<p>Name</p>
<input type="text" placeholder="FullName" id="name" >
<p>Email</p>
<input type="email" placeholder="Enter e-mail" id="email">
<p>Password</p>
<input type="password" placeholder="Enter Password" id="pass">
<p>Phone Number</p>
<input type="text" placeholder="Enter Number" id="number"><br>
<input type="submit" id="submit">
</form>
</div>
</body>
</html>
<script>
document.querySelector("#form").addEventListener("submit", signUpFun);
var userData = JSON.parse(localStorage.getItem("userCreds"))||[]
function signUpFun() {
event.preventDefault();
var userObj = {
email: document.querySelector("#email").value,
password: document.querySelector("#pass").value,
};
userData.push(userObj);
localStorage.setItem("userCreds",JSON.stringify(userData))
}
document.querySelector("#form").addEventListener("submit", signUpFunc)
function signUpFunc(){
console.log("kuchv");
}
</script>