Simple Text Highlighting via Unobtrusive JavaScript
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.markdown
demo.html
highlightText.jquery.json
jquery.highlightText.js
jquery.highlightText.min.js

README.markdown

jQuery highlightText

Simple Text Highlighting via Unobtrusive JavaScript

The jQuery Text Highlight Plugin can be used if you want to highlight query words in the User Interface.

Methods

  • highlightText(text, options): returns each element which contains a text node that matches text

Supported properties

The highlightText function accepts the following options:

  • cssClass: the CSS class name to be added to the span that acts like a container for the matched text (defaults to mark)
  • ignoreCase: turn on/off case-insensitive mode (defaults to true)

Example use

Check out the demo.html page.

Copyright

Copyright © 2013 Kjel Delaey, released under the MIT license.