-
Notifications
You must be signed in to change notification settings - Fork 0
/
prep_pro2.html
59 lines (52 loc) · 1.45 KB
/
prep_pro2.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
<html>
<head>
<title>Image Hit|Sign Up</title>
<script type = "text/javascript" src = "prep_pro.js"> </script>
<script src='https://code.jquery.com/jquery-2.2.4.js'></script>
</head>
<body>
<h1><b> Sign Up<b><h1>
<form action="prep_signin.html" method="POST"
<div>
<div class = "inputs">
Name:<br>
<input type = "text" id = "name"></input>
</div>
<br>
<div class = "inputs">
Email:<br>
<input type = "text" id = "email" value=""></input>
</div>
<br>
<div class = "inputs">
Password:<br>
<input type = "text" id = "password"></input>
</div><br>
<button id = "singup">Sign Up</button>
</div>
</form>
<script>
$('h1').css('font-size', '50px')
$('.inputs').css('font-size', '25px')
var signup=document.getElementsByTagName('button')[0];
//global signup array
signup.addEventListener('click',make,false);
//var storedNames = JSON.parse(localStorage.getItem("userarray"));
function make(){
var name1= document.getElementsByTagName("input")[0].value;
var email1=document.getElementsByTagName("input")[1].value;
var password1=document.getElementsByTagName("input")[2].value;
var obj={};
obj['name']=name1;
obj['email']=email1;
obj['password']=password1;
var newAdd = JSON.parse(localStorage.getItem("userarray"))
newAdd.push(obj)
console.log(newAdd)
localStorage.setItem("newAdd", JSON.stringify(newAdd));
//localStorage.setItem("x",name1)
/* localStorage.setItem("userarray", JSON.stringify(userarray));*/
}
</script>
</body>
</html>