Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get id of a node in TinyMCE?

Tags:

tinymce

I want to get the id of a node inside TinyMCE.

I searched in the documentation, but could not find this.

How can this be done?

like image 708
KutePHP Avatar asked Jul 19 '10 07:07

KutePHP


1 Answers

First, it is important which node you want to get the id from. If you want to get the if of the parent node of your selection in TinyMCE use

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

EDIT: In case you have a single node in your editor you can access this node id using

tinymce.activeEditor.getBody().firstChild.id;
like image 97
Thariama Avatar answered Jan 03 '23 12:01

Thariama