3

I try to use jquery to highlight text.

I have follow this fiddle solution : http://jsfiddle.net/thelinh/UPs3V/

enter image description here

It's work to search and highlight text that don't contain line break tags (<br/>) tags.

But in case text contain <br/> tags. the solution doesn't work.

Please help me.

Thanks.

enter image description here

http://jsfiddle.net/UPs3V/80/

enter image description here

Thelinh Truong
  • 564
  • 1
  • 8
  • 19
  • 1
    Please use inline code within markup instead of pointing to external websites Thelinh. Try to make the question self-contained, and use the images and outside links only for clarification. – Maarten Bodewes Nov 07 '12 at 18:29
  • 1
    And of course the obligatory remark: http://stackoverflow.com/a/1732454/589259 – Maarten Bodewes Nov 07 '12 at 18:31

1 Answers1

0

try replacing your term with

var term = "high(?:<br\s*/?>)?lighting";
Lodewijk Bogaards
  • 19,777
  • 3
  • 28
  • 52