Highlight overlapping text in JQuery

Posted by Jasie on Stack Overflow See other posts from Stack Overflow or by Jasie
Published on 2010-03-16T09:19:38Z Indexed on 2010/03/16 9:36 UTC
Read the original article Hit count: 293

Filed under:
|

I've got this plain HTML:

"Many things are in my room: a bed, a desk, and a computer."

And these phrases:

"things are"
"are in my room" 
"room: a bed"

In JQuery, is there some way to loop through the phrase list, and highlight the phrases as they appear in the text, and have the overlap delineated by color, or border, etc?

I know there are simple highlighters but that won't do the trick. Maybe something with overlaying opacities? Thanks!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about highlighting