cel committed Migrate to git-ssbLatest: 5e58ae1 on 6/11/2018, 9:23:00 PM | |
📄 | README.md |
📄 | example.html |
📄 | index.js |
📄 | package.json |
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 container
highlightTagName
:String
(default:"highlight"
)Use the given tag name for highlight elements
Methods
setQuery(String query)
Set the search query
selectNext()
Select the next text segment matching the query
selectPrevious()
Select the previous text segment matching the query
highlight()
Highlight matching search results
unhighlight()
Remove any highlighting of search results
Properties
Element container
The container within which text will be searched
RegExp query
The current query. Use setQuery unless you actually want to specify a regular expression.
TODO
- Match text that spans multiple text nodes
License
Fair
Built with git-ssb-web