Page tree

Versions Compared

Key

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

Status
colourYellow
title

...

RELEASE 2.11.0

...

OR ABOVE

Selection을 기준으로 HTML Element 배열을 반환합니다. Selection이 지정되지 않은 경우 현재 Selection에 해당하는 HTML Element를 반환합니다.


Parameters:

Name

Type

Attribute

Description

selectionObject

Object

{
    anchor: { Position },
    focus:  { Position }
}

[ Optional ] anchor position과 focus position을 가지는 selection object. 이 값이 없으면 현재 Selection기준으로 동작합니다.

Return:

TypeDescription
HTML Element[]Selection에 해당하는 HTML Element 배열. 캐럿 상태에서는 캐럿이 위치한 HTML Element를 배열로 반환합니다.



Example:

Code Block
languagejs
themeEmacs
titleselection을 지정하지 않은 경우
var elements = editor.getHTMLElements();
console.log(elements[0].innerHTML);

...