Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
dynamic dom node filtering via callback
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
History.md
Makefile
Readme.md
component.json
index.js
package.json
test.html

Readme.md

filter

dynamic dom node filtering via callback.

Installation

$ component install component/filter

Example

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);
  });
};

License

MIT

Something went wrong with that request. Please try again.