filter-component

dynamic dom node filtering

filter

dynamic dom node filtering via callback.

$ component install component/filter

When list items contain the relevant text a .hide class is added for styling the filter.

var filter = require('filter');
var ul = document.querySelector('ul');
var input = document.querySelector('input');
 
input.onkeyup = function(e){
  var str = input.value;
  filter(ul, function(li){
    return ~li.textContent.indexOf(str);
  });
};

MIT