-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcheck.html
More file actions
58 lines (52 loc) · 1.76 KB
/
check.html
File metadata and controls
58 lines (52 loc) · 1.76 KB
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
<!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">
<link rel="stylesheet" href="data.css">
<link rel = "icon" type = "image/png" href = "assets/mini.png">
<title>Randomly - Checking</title>
</head>
<body >
<div class="header">
<div class="logo"><img src="./assets/loogo.png"></div>
</div>
<div class="container">
<div class="check">
<h4>Check if everything ok</h4>
<p class="subtitle" id="toUpdate"></p>
<table id="table">
<tr> <th>Names</th> <th>Subjects</th> </tr>
</table>
<div class="btns">
<button onclick="Cancel()" id="updatebtn">Cancel</button>
<button onclick="next()">Next</button>
</div>
</div>
</div>
</body>
</html>
<script>
//get the data from local storage
var names = JSON.parse(localStorage.getItem("names"));
var subjects = JSON.parse(localStorage.getItem("subjects"));
var length = subjects.length;
//table to display data on it
var table = document.getElementById("table");
for(var i=0 ; i < length ; i++){
var row = table.insertRow();
var cell = row.insertCell();
//lenght == subjects.length
// case :( subjects.length > name.length)
if(typeof names[i] === 'undefined'){
// name[i] == undefined => return '-----' in table
cell.innerHTML = "------";
}else{
cell.innerHTML = names[i];
}
cell = row.insertCell();
cell.innerHTML = subjects[i];
}
</script>
<script src="data.js"></script>