Skip to main content

ASPxClientHtmlEditor.HighlightText(text, searchContainer) Method

Highlights the text with the specified text color and background color.

Declaration

static HighlightText(
    text: string,
    searchContainer: any,
    color?: string,
    backgroundColor?: string
): void

Parameters

Name Type Description
text string

A string value specifying the text to be highlighted.

searchContainer any

An object specifying the container where the specified text should be searched.

color string

A string value specifying the text color.

backgroundColor string

A string value specifying the background color.

Remarks

// highlights all 'word1' entries inside a DOM element
var searchText = "word1";
var mailViewNavBarElement = document.getElementById(...);
var cssClassForFoundEntriesDecoration = "highlight-search";
ASPxClientHtmlEditor.HighlightText(searchText, mailViewNavBarElement, cssClassForFoundEntriesDecoration);

// removes highlighting
ASPxClientHtmlEditor.HighlightText(null, mailViewNavBarElement);
See Also