How to get node ID in TinyMCE?

I want to get the node identifier inside TinyMCE.

I searched in the documentation but could not find this.

How can I do that?

+5
source share
1 answer

Firstly, it is important which node you want the identifier from. If you want to get if from the parent node of your choice in TinyMCE, use

tinymce.activeEditor.selection.getNode().id;

EDIT: if you have one node in your editor, you can access this node icon using

tinymce.activeEditor.getBody().firstChild.id;
+6
source

All Articles