Thursday, December 13, 2018

Search keywords in HTML content and highlight


Declare below variables in class
highlightClass = "highlightText";
highlightRe: any;
spaceRe = /\s+/;
spaceRe2 = /\s+$/;
before: any = "";
after: any = "";