view test-data/res_files/js/filter.js @ 71:71d5983dd41e draft

"planemo upload for repository https://github.com/GReD-Clermont/sRNAPipe/ commit d75c5bb2b0fc1f53f648a59312f13f9b23e6a6dc"
author brasset_jensen
date Thu, 06 Feb 2020 11:10:41 -0500
parents 9185ca0a7b43
children
line wrap: on
line source

function search(input) {
  // Declare variables
  var elt, filter, uls, li, a, i;
  elt = input.parentElement;
  filter = input.value.toUpperCase();
  uls = elt.getElementsByClassName('thumbs');

  // Loop through all list items, and hide those who don't match the search query
  for (j = 0; j < uls.length; j++) {
    li = uls[j].getElementsByTagName('li');
    for (i = 0; i < li.length; i++) {
      a = li[i].getElementsByTagName("a")[0];
      if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {
        li[i].style.display = "";
      } else {
        li[i].style.display = "none";
      }
    }
  }
}