Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/component/filter
dynamic dom node filtering via callback
https://github.com/component/filter
Last synced: 13 days ago
JSON representation
dynamic dom node filtering via callback
- Host: GitHub
- URL: https://github.com/component/filter
- Owner: component
- Created: 2012-11-27T18:11:25.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-10-09T23:30:34.000Z (about 11 years ago)
- Last Synced: 2024-05-08T17:11:03.498Z (8 months ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 6
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# 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.```js
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