I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word "dolor" in this text:
You can use my highlight plugin jQuiteLight, that can also work with regular expressions.
To install using npm type:
npm install jquitelight --save
To install using bower type:
bower install jquitelight
Usage:
// for strings
$(".element").mark("query here");
// for RegExp
$(".element").mark(new RegExp(/query h[a-z]+/));
More advanced usage here