-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignUp.html
76 lines (70 loc) · 2 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
<!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>
<style>
#container{
width: 20%;
margin: auto;
display: flex;
flex-direction: column;
align-items: center;
background-color:rgb(163, 195, 196);
padding:10px;
}
form{
margin: -25px 0px 5px 0px;
padding: 25px;
}
input[type=name],input[type=email],input[type=text]{
width: 90%;
padding: 8px;
margin: 5px 0px;
}
input[type=submit],button{
width: 100%;
margin: 5px 0px;
padding: 8px;
border: 0;
background-color: grey;
}
div > h2{
font-weight: normal;
margin-top: 20px;
}
</style>
</head>
<body>
<div id="container">
<h2>-Visitor-</h2>
<form action="">
<input type="name" name="UserName" placeholder="Full name" id="name"><br>
<input type="email" name="Email" id="email" placeholder="Email"><br>
<input type="text" name="text" id="org" placeholder="Organization"><br>
<input type="submit"><br>
<button>Return</button>
</form>
</div>
</body>
</html>
<script>
document.querySelector("form").addEventListener("submit",SignUp);
var arr = [];
function SignUp(e){
e.preventDefault();
var UserName = document.getElementById("name").value;
var Email = document.getElementById("email").value;
var Org = document.getElementById("org").value;
var info={
user:UserName,
Email: Email,
Org: Org,
};
console.log(info);
arr.push(info);
localStorage.setItem("user", JSON.stringify(arr));
}
</script>