TinyMCE (or JCE) - How to get the current node name and html content

I am trying to check at which node the cursor / selection is.

I want to receive

  • node name
  • html inside node
+4
source share
1 answer

Access to node is possible with:

tinyMCE.activeEditor.selection.getNode() 

And there are 2 properties that will return the required values: nodeName and innerHTML

 tinyMCE.activeEditor.selection.getNode().nodeName tinyMCE.activeEditor.selection.getNode().innerHTML 
+8
source

Source: https://habr.com/ru/post/1433578/


All Articles