-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.php
43 lines (36 loc) · 1.08 KB
/
dashboard.php
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>dashboard</title>
<link rel="stylesheet" href="./table.css">
</head>
<body>
<form method="GET">
<input type="search" id="search" autocomplete="off" name="s">
<input type="submit" value="search" name="s">
</form>
<?php require_once('./tableau.php'); ?>
<script src="./table.js">
function searchTable() {
let input, filter, table, tr, td, textValue;
input = document.getElementById("search");
filter = input.value.toUpperCase();
table = document.querySelector('table');
tr = table.getElementsByTagName("tr");
for (let i = 0; i < tr.length; i++) {
// console.log("it is work");
td = tr[i].getElementsByTagName("td")[0];
if (td) {
textValue = td.textContent || td.innerText;
if (textValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
</script>
</body>
</html>