Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
jQuery Plugin that lets you highlight document text with a regular expression.
branch: master

This branch is 25 commits behind jbr:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.textile
demonstration.html
jquery.highlightRegex.js

README.textile

jQuery highlightRegex plugin

Want to highlight some text on a page with information you only know in javascript, maybe based on some dynamic input? Check out the highlight v3
by Johann Burkard. Need to be able to do the same thing but with a regular expression? You’re at the right place.

Demonstration

Check out a simple demo here. (source included in this repository).

Usage

At this point, it’s very simple:

$('#any.jquery.selector').highlightRegex(/[aeiou]/ig);

This would wrap all all vowels inside of #any.jquery.selector with a <span class='highlight'>.

To clear the highlighting, just call $('#any.jquery.selector').highlightRegex(); (with no argument).

Something went wrong with that request. Please try again.