Fast and easy searching inside a page.
Installation
$ npm install --save holmes.js
After which you can add it in your page with i.e. browserify or loading the module in a different script tag.
You have to make sure that you have a css
rule for the class .hidden
that hides elements however you want. One option is to have this:
.hidden {
display: none;
}
but this could be any css
you want.
Usage
holmes({
input: '.search input', // queryselector for the input
find: '.results article', // queryselector for element to search in
placeholder: 'no results' // (optional) text to show when no results
});
Questions?
Compatible up to IE9.
Let me know on twitter: @haroenv.
License
Apache 2.0