mirror of
https://github.com/toddmotto/public-apis.git
synced 2021-09-13 01:36:33 +00:00
Use Vue method to filter search listings
This commit is contained in:
@@ -34,23 +34,3 @@ new Vue({
|
||||
}
|
||||
}
|
||||
}).$mount('#app');
|
||||
|
||||
function filterRows() {
|
||||
var input, filter, table, tr, td, i;
|
||||
input = document.getElementById("searchbox");
|
||||
filter = input.value.toUpperCase();
|
||||
table = document.getElementById("entries");
|
||||
tr = table.getElementsByTagName("tr");
|
||||
|
||||
// Loop through all table rows and hide those who don't match the search
|
||||
for (i = 0; i < tr.length; i++) {
|
||||
td = tr[i].getElementsByTagName("td")[0];
|
||||
if (td) {
|
||||
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
|
||||
tr[i].style.display = "";
|
||||
} else {
|
||||
tr[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user