1.1.1 • Published 9 years ago
text-node-searcher v1.1.1
Text Node Searcher
Search for text in a web page
API
Contructor
new TextNodeSeacher(Object options)Create a searcher for text nodes
Options
container:Element(default:document.body)Search for nodes within the given containerhighlightTagName:String(default:"highlight")Use the given tag name for highlight elements
Methods
setQuery(String query)Set the search queryselectNext()Select the next text segment matching the queryselectPrevious()Select the previous text segment matching the queryhighlight()Highlight matching search resultsunhighlight()Remove any highlighting of search results
Properties
Element containerThe container within which text will be searchedRegExp queryThe current query. Use setQuery unless you actually want to specify a regular expression.
TODO
- Match text that spans multiple text nodes
License
Fair