DS Server

Javascript: Selection.removeInlineStyles Method

Method|Introduced in 24.0

Description

Removes all character based styles of the selected text so that all attributes are reset to the attributes of the paragraph style.

Syntax

<void> Selection.removeInlineStyles([<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Optional. Is called when the operation completed.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates Selection.removeInlineStyles in a practical document-editing workflow. It removes all character based styles of the selected text so that all attributes are reset to the attributes of the paragraph style.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.selection.removeInlineStyles(
    function() {
        console.log("remove inline styles completed.");
    },
    onTxError
);