search for dom elements on your page
holmes
(require("holmes"))
(require("holmes"))()
search for dom elements on your page
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options.input |
string |
optional |
'input[type=search]' | A querySelector to find the input |
options.find |
string | A querySelectorAll rule to find each of the find terms |
||
options.placeholder |
string |
optional |
Text to show when there are no results (innerHTML ) |
|
options.class.visible |
string |
optional |
false | class to add to matched items |
options.class.hidden |
string |
optional |
'hidden' | class to add to non-matched items |
options.dynamic |
boolean |
optional |
false | Whether to query for the content of the elements on every input.
If this is false , then only when initializing the script will
fetch the content of the elements to search in. If this is true
then it will refresh on every input event. |
options.contenteditable |
boolean |
optional |
false | whether the input is a contenteditable or not. By default it's
assumed that it's <input> , true here
will use <div contenteditable> |
options.instant |
boolean |
optional |
false | By default Holmes waits for the DOMContentLoaded event to fire
before listening. This is to make sure that all content is available. However
if you exactly know when all your content is available (ajax, your own event or
other situations), you can put this option on true . |