-
Notifications
You must be signed in to change notification settings - Fork 10
/
topics_html_template.html
67 lines (46 loc) · 1.56 KB
/
topics_html_template.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
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NHS Open Repositories by Topic</title>
<style type="text/css">
table {
border-collapse: collapse;
width: 100%;
margin: 20px auto;
padding: 20px;
}
input[type="text"] {
width: 100%;
padding: 8px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<input type="text" id="searchInput" placeholder="Search for GitHub Tag (search multiple tags separated by commas)">
<script>
// Get the input field and table
var input = document.getElementById("searchInput");
var table = document.getElementById("T_7c1e7");
var rows = table.getElementsByTagName("tr");
input.addEventListener("input", function() {
var filter = input.value.toLowerCase().split(",").map(tag => tag.trim());
for (var i = 1; i < rows.length; i++) {
var row = rows[i];
var cell = row.getElementsByTagName("td")[2];
if (cell) {
var text = cell.textContent || cell.innerText;
var country = text.toLowerCase();
var match = filter.some(tag => country.indexOf(tag) > -1);
if (match) {
row.style.display = "";
} else {
row.style.display = "none";
}
}
}
});
</script>
</body>
</html>