TextRun
TextRun extends Element
이것은 텍스트를 편집하는 데 사용되는 API 모델입니다.
메서드
remove()
요소 자체를 제거합니다.
모든 요소를 제거하면 이후 작업에서 오류가 발생할 수 있습니다.
var run = editor.getAPIModelById('id');
run.remove();
replace(html)
| 이름 | 타입 | 설명 |
|---|---|---|
| html | <String> | 대체할 HTML 문자열입니다. |
요소 자체를 주어진 HTML 문자열로 교체합니다.
var run = editor.getAPIModelById('id');
run.replace('<span>TextRun replaced</span>');
setText(text)
| 이름 | 타입 | 설명 |
|---|---|---|
| text | <string> | TextRun에 설정할 텍스트 string입니다. |
주어진 텍스트를 TextRun에 설정합니다.
var run = editor.getAPIModelById('id');
run.setText('This is the content inside a text run.');