-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_acc.html
83 lines (75 loc) · 2.71 KB
/
create_acc.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/styles.css">
<script src="components/header.js"></script>
<script src="components/footer.js"></script>
<title>Login Page</title>
</head>
<header-component></header-component>
<section class="creatacc_section">
<div class="athcontainer">
<div class="ath img">
<img src="iphone.jpg.png" alt="" class="ath image">
</div>
<div class="ath content">
<form action="" class="ath form">
<h2 class="formtittle">Create your account</h2>
<p class="ath p">Enter Your Detail Below</p>
<div class="formgrp">
<input type="text" placeholder="Name" class="forminp" data-field="Name"/>
</div>
<div class="formgrp">
<input type="email" placeholder="Email" class="forminp" data-field="Email"/>
</div>
<div class="formgrp formpass">
<input type="password" placeholder="Password" class="forminp" data-field="Password"/>
</div>
<div class="formgrp">
<button class="formbtn">
<a href="#" class="formlink" style="color: white;">Create Account</a>
</button>
</div>
<div class="formgrp">
</span>
</div>
</form>
</div>
<div class="acc_img">
<img src="image/create_acc_page/create_acc_page.jpg" alt="Create_Account" >
</div>
</div>
</section>
<footer-component></footer-component>
<script>
let form = document.querySelector('.ath form');
let fields = document.querySelectorAll(".forminp");
fields.forEach(field => {
field.addEventListener("blur", () => {
if(field.getAttribute("data-field")=='Name'){
let u_name=field.value;
console.log(u_name);
localStorage.setItem("UserName",field.value);
}
if(field.getAttribute("data-field")=='Email'){
let email=field.value;
localStorage.setItem("Email",field.value);
console.log(email);
}
if(field.getAttribute("data-field")=='Password'){
let password=field.value;
localStorage.setItem("Password",field.value);
console.log(password);
}
});
});
let submit=document.querySelector(".formbtn");
submit.addEventListener("click",()=>{
fields.forEach(field => {
field.value = "";
});
alert("You have successfully created your account");
})
</script>