Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
themeEmacs
var paragraphrun = editor.getAPIModelById('id');
paragraphrun.append('<span>TEXT</span>');

...

Code Block
languagejs
themeEmacs
var paragraphrun = editor.getAPIModelById('id');
paragraphrun.prepend('<span>TEXT</span>');

remove()

Element 자신을 제거합니다.

Code Block
languagejs
themeEmacs
var paragraph = editor.getAPIModelById('id');
paragraph.remove();

replace(html)

  • html <String> 교체할 HTML String.

Element 자신을 파라메터로 넘겨받은 HTML String으로 교체합니다.

Code Block
languagejs
themeEmacs
var paragraph = editor.getAPIModelById('id');
paragraph.replace('<p><span>Paragraph replaced</span></p>');

setHeading(value)

  • value <String> tagName ('P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6')

문단을 표현할 tagName을 설정합니다. 
ex) 'P', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6'

P tag로 설정되어 있는 문단을 'H1'으로 설정하면 <H1> tag로 변경됩니다.

setText(text)

  • text <String> 문단에 설정할 Text 문자열

문단에 텍스트런에 파라메터로 넘겨받은 Text 문자열값을 Text로 설정합니다.

Code Block
languagejs
themeEmacs
var paragraphrun = editor.getAPIModelById('id');
paragraphrun.setText('문단에텍스트런에 들어가는 내용입니다.');