-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
76 lines (61 loc) · 2.14 KB
/
script.js
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
function signup(){
var fullname = document.getElementById("fullname").value;
var mobile = document.getElementById("mobile").value;
var dob = document.getElementById("dob").value;
var addr = document.getElementById("addr").value;
var email = document.getElementById("emails").value;
var pswrd = document.getElementById("pswrds").value;
var input = document.getElementsByTagName("input");
localStorage.setItem("name1", fullname);
localStorage.setItem("mob1", mobile);
localStorage.setItem("dob1", dob);
localStorage.setItem("addr1", addr);
localStorage.setItem("email1", email);
localStorage.setItem("pswrd1", pswrd);
if( fullname == '' || mobile == '' || dob == '' || addr == '' || email == '' || pswrd == '' ){
alert("please enter credentials");
}
else{
confirm("User registration sucessfully done!");
}
input.value = '';
}
function login(){
var email = document.getElementById("email").value;
var pswrd = document.getElementById("pswrd").value;
var email2 = localStorage.getItem("email1");
var pswrd2 = localStorage.getItem("pswrd1");
if(email == '' || pswrd == ''){
alert("please enter credentials");
}
else if(email== email2 && pswrd == pswrd2){
window.location.href="Home.html";
}
else{
alert(" User does not Exist or email and password are incorrect");
}
}
$(document).ready(function(){
const bars= document.querySelectorAll(".progress_b");
bars.forEach(function(bar){
let percentage = bar.dataset.percent;
let tooltip = bar.children[0];
tooltip.innerText = percentage + '%';
bar.style.width = percentage + '%';
})
});
function logout(){
localStorage.removeItem("email1");
localStorage.removeItem("pswrd1");
window.location.href="index.html";
}
// function checkLogin(){
// console.log("hi");
// var email2 = localStorage.getItem("email1");
// var pswrd2 = localStorage.getItem("pswrd1");
// if(email2 && pswrd2){
// window.location.href="Home.html";
// }else{
// window.location.href="index.html";
// }
// }