view lib/sRNAPipe/js/filter.js @ 64:967512924317 draft

planemo upload for repository https://github.com/GReD-Clermont/sRNAPipe/ commit 410509088292be0687b8da3ea3bb75e72866a87d
author brasset_jensen
date Mon, 28 Jan 2019 11:57:15 -0500
parents
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";
      }
    }
  }
}