Javascript: Selection.getItalic Method
Description
Gets the italic attribute of the selected text.
Syntax
<void> Selection.getItalic(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the italic attribute of the selected text. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates Selection.getItalic in a practical document-editing workflow. It gets the italic attribute of the selected text.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
TXTextControl.selection.getItalic(
function(result) {
if (result) {
console.log("get italic is available.");
} else {
console.warn("get italic is not available in the current document state.");
}
},
onTxError
);