getText
2.3.0 버전부터 지원합니다.
public getText(selector: String)
DOM 선택자를 지정하여 편집할 텍스트를 추출할 수 있는 API입니다.
추출 가능한 DOM: <div>, <td>, <p>, <span>
매개변수: 선택자
| 이름 | 타입 | 설명 |
|---|---|---|
selector | string | 편집할 DOM을 가져오는 선택자입니다. |
반환: 텍스트
| 이름 | 타입 | 설명 |
|---|---|---|
test | string | DOM에서 추출된 텍스트입니다. |
예시
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');