lambda on forEach loop for matching search query
This commit is contained in:
@ -25,9 +25,9 @@
|
|||||||
<script>
|
<script>
|
||||||
function search() {
|
function search() {
|
||||||
var input, filter, i;
|
var input, filter, i;
|
||||||
input = document.querySelector('#searchInput');
|
input = document.querySelector('searchInput');
|
||||||
filter = input.value.toUpperCase();
|
filter = input.value.toUpperCase();
|
||||||
tags = Array.from(document.querySelector('#snippetListDrawer').getElementsByTagName('a'));
|
tags = Array.from(document.querySelector('snippetListDrawer').getElementsByTagName('a'));
|
||||||
|
|
||||||
tags.forEach(x => {x.getAttribute("href").toUpperCase().indexOf(filter) > -1 ? x.style.display = "" : x.style.display = "none"});
|
tags.forEach(x => {x.getAttribute("href").toUpperCase().indexOf(filter) > -1 ? x.style.display = "" : x.style.display = "none"});
|
||||||
// for(var i = 0; i < tags.length; i++) {
|
// for(var i = 0; i < tags.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user