tags:

views:

10

answers:

1

I want to get id of the node inside tiny mce. I searched in documentation, but could not found. :(

Thanks in advance

A: 

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;
Thariama
Hi Thariama, Thanks for the solution. This gives the exact Id I want, but only after, I select some text inside the editor. I have a single node inside the editor and want to get it's id where user may select or may not select the text inside it. Thanks
KutePHP
in that case (single node inside the editor) you may use tinymce.activeEditor.getBody().firstChild.id;
Thariama