Body 영역을 편집하는데 사용되는 API 모델입니다. 사이냅에디터에서 Body영역은 The API model used to edit the Body area. In Synap Editor, the body area is composed of <div class='se-contents'></div>로 구성되어 있습니다div>.
Methods
append(html)
- html <String> 추가할 HTML <String> HTML String to append.
인자로 넘겨받은 HTML String으로 Element의 뒤쪽에 자식으로 추가합니다The HTML String passed as an argument is added as a child at the back of the Element.
Code Block |
---|
|
var body = editor.getAPIModels('.se-contents')[0];
body.append('<p><span>APPEND TEXT</span></p>'); |
prepend(html)
- html <String> 추가할 HTML <String> HTML String to prepend.
인자로 넘겨받은 HTML String으로 Element의 앞쪽에 자식으로 추가합니다The HTML String passed as an argument is added as a child to the front of the Element.
Code Block |
---|
|
var body = editor.getAPIModels('.se-contents')[0];
body.prepend('<p><span>PREPEND TEXT</span></p>'); |
replace(html)
- html <String> 교체할 <String> The HTML String to replace.
Element 자신을 인자로 넘겨받은 HTML String으로 교체합니다Replaces the element itself with the HTML String passed as an argument.
Code Block |
---|
|
var body = editor.getAPIModels('.se-contents')[0];
body.replace('<p><span>Body replaced</span></p>'); |
setHTML(html)
- html <String> 설정할 HTML 문자열
...
- <String> HTML string to set
Sets the HTML string value passed as an argument to the body's internal HTML.
Code Block |
---|
|
var body = editor.getAPIModels('.se-contents')[0];
body.setHTML('<p><span>본문에 HTML를 추가합니다. 기존에 입력된 내용은 모두 지워집니다<p><span>Add HTML to the body. All previously entered information will be erased.</span></p>'); |
setText(text)
- text <String> 설정할 Text 문자열
...
- <String> Text string to set
Set the text string value passed as an argument to the internal text of the body.
Code Block |
---|
|
var body = editor.getAPIModels('.se-contents')[0];
body.setText('본문에 텍스트를 추가합니다. 기존에 입력된 내용은 모두 지워집니다Add text to the body. All previously entered information will be erased.'); |