Page tree

Versions Compared

Key

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

Status
title릴리즈 2.3.0 이상


public setText(selector: String, text: String)

편집할 DOM selector를 지정하여 text를 삽입 할 수 있는 API입니다.

  • 삽입 가능 DOM: <div>, <td>, <p>


Params: selector, text

NameTypeDescription
selectorstring편집할 DOM을 가져올 selector
textString삽입할 text


Example:

Code Block
languagejs
themeEmacs
window.editor.setText('#field', 'Filed Text');
window.editor.setText('#name', 'Name Text');
window.editor.setText('#birth', 'Birth day');
window.editor.setText('#address', 'Address');
window.editor.setText('#phone', 'Phone number');
window.editor.setText('#copyright', 'Copyright');



public setTextBySelectors(datas: Array)

편집할 DOM selector들을 지정하여 text를 한번에 삽입 할 수 있는 API입니다.

  • 삽입 가능 DOM: <div>, <td>, <p>


Params: selector, text

NameType
Description
datasArray

[ Object]

  • {
    selector: String,
    text: String
    }
편집할 DOM을 가져올 selector와 text


Example:

Code Block
languagejs
themeEmacs
window.editor.setTextBySelectors([{'#field', 'Filed Text'}, {'#name', 'Name Text'}, {'#birth', 'Birth day'}]);



체험하기

Include Page
DEMO:DOM API
DEMO:DOM API