Covers the class of DOM manipulation APIs identified by dom.DOMUtils:
tinymce.dom.createFragment()
tinymce.dom.addClass()
tinymce.dom.removeClass()
tinymce.dom.select()
- etc.
TinyMCE's dom.DOMUtils
provides an API to the DOM within the TinyMCE editor.
It can be accessed globally (tinymce.dom
) and also scoped to the active editor (tinymce.activeEditor.dom
).
Some methods of object include select()
(for selecting an element), createFragment()
(for creating a new element), and so on.
One existing use of dom.DOMUtils
is to programmatically manipulate post content:
var innerHTML = '<!-- html-comment -->' + toolbar.element.innerHTML + '<!-- /html-comment -->';
var newEl = editor.dom.createFragment( innerHTML );
editor.dom.replace( newEl, origEl );
Please open a new issue to suggest additional examples of existing usage.
There isn't get an equivalent API in Gutenberg. See these issues for related conversation: