-
Notifications
You must be signed in to change notification settings - Fork 0
/
selection.js
50 lines (48 loc) · 1.32 KB
/
selection.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
var n=document.querySelector("input");
function store(){
var a= localStorage.getItem("name_"+n.value);
if ( a ==null){
a=localStorage.getItem("tech_"+n.value)
if (a==null) {
alert("User Does Not Exist !!");
refresh();
}
}
// var keylist=keys(n);
// for (let index = 0; index < keylist.length; index++) {
// const e = keylist[index];
// adding(e);
// }
adding(a);
};
function adding(applicant) {
var arr=applicant.split(",");
for (let index = 0,y=0; index < arr.length; index++,y++) {
const x = arr[index];
var z="NAME : ";
if(y==1){
z="NOTES : ";
}else if(y==2){
z="TECHNOLOGY : ";
}else{
z="ID : ";
}
$("ul").append("<li> "+z+x+"</li>");
z="NAME : ";
}
}
function refresh() {
//n.textContent="";
location.reload(true);
}
// function keys(n){
// var keyList=[];
// for ( var i = 0, len = localStorage.length; i < len; i++ ) {
// var m=(localStorage.key( i ));
// if (m=="name_"+n.value || m=="tech_"+n.value) {
// m=localStorage.getItem(m);
// keyList.push(m);
// }
// }
// return keyList;
// }