diff --git a/knowledge-base/editor-get-selection.md b/knowledge-base/editor-get-selection.md index 17dc0e0bcb..0984769056 100644 --- a/knowledge-base/editor-get-selection.md +++ b/knowledge-base/editor-get-selection.md @@ -1,11 +1,10 @@ --- title: Get the content of the Editor selected by the user -description: How to get the content of the Editor selected by the user +description: Learn how to retrieve the selected text from the Telerik Editor using JavaScript to apply custom formatting dynamically. type: how-to page_title: Get the user selection in the Editor slug: editor-kb-get-selection -position: -tags: +tags: blazor, editor, selection res_type: kb --- @@ -53,7 +52,7 @@ If you want to use it on the .NET (Blazor) side, you need to: @inject IJSRuntime js - + Get selected text @@ -61,15 +60,14 @@ If you want to use it on the .NET (Blazor) side, you need to: - Selected text: @SelectedText @code { - string TheEditorContent { get; set; } = "

Lorem ipsum

Dolor sit amet.

"; - List Tools { get; set; } - public string SelectedText { get; set; } + private string TheEditorContent { get; set; } = "

Lorem ipsum

Dolor sit amet.

"; + private List Tools { get; set; } + private string SelectedText { get; set; } - async Task GetSelectedText() + private async Task GetSelectedText() { SelectedText = await js.InvokeAsync("getSelectedText"); } @@ -120,15 +118,14 @@ If you want to use it on the .NET (Blazor) side, you need to:
- Selected text: @SelectedText @code { - string TheEditorContent { get; set; } = "

Lorem ipsum

Dolor sit amet.

"; - List Tools { get; set; } - public string SelectedText { get; set; } + private string TheEditorContent { get; set; } = "

Lorem ipsum

Dolor sit amet.

"; + private List Tools { get; set; } + private string SelectedText { get; set; } - async Task GetSelectedText() + private async Task GetSelectedText() { SelectedText = await js.InvokeAsync("getSelectedText"); }