Page tree

Versions Compared

Key

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

...

public getText(selector: String)

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

...

API to extract text by designating the DOM selector.

  • Extractable DOM: <div>, <td>, <p>, <span>


Params: selector

NameTypeDescription
selectorstring편집할 DOM을 가져올 selectorSelector to get DOM to edit


Return: text

NameTypeDescription
teststringDOM에서 추출한 textText extracted from DOM


Example:

Code Block
languagejs
themeEmacs
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');

...



Experiencing

Include Page
DEMO:DOM API
DEMO:DOM API