Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

RELEASE 2.11.0 OR ABOVE

Returns an HTML Element based on Position. If Position is not specified, returns the HTML Element at the current caret position.


Parameters:

Name

Type

Attribute

Description

position

Position
[ Optional ] Position information in Selection. If this value is not specified, it is treated as the current caret position information.

Return:

TypeDescription
HTML ElementHTML Element corresponding to Position



Example:

position을 지정하지 않은 경우
var element = editor.getHTMLElement();
console.log(element.innerHTML);
Selection을 이용해서 position을 지정한 경우
var selection = editor.getSelection();
var startElement = editor.getHTMLElement(selection.start);
console.log(startElement.innerHTML);
var endElement = editor.getHTMLElement(selection.end);
console.log(endElement.innerHTML);
  • No labels