getText
Release 2.3.0 and above.
public getText(selector: String)
An API that allows you to extract text by specifying the DOM selector to edit.
Extractable DOM: <div>, <td>, <p>, <span>
Params: selector
| Name | Type | Description |
|---|---|---|
selector | string | Selector to retrieve the DOM to edit. |
Return: text
| Name | Type | Description |
|---|---|---|
test | string | Text extracted from the DOM. |
Example:
let field = window.editor.getText('#field');
let name = window.editor.getText('#name');
let birth = window.editor.getText('#birth');
let address = window.editor.getText('#address');
let phone = window.editor.getText('#phone');
let copyright = window.editor.getText('#copyright');