How can the tinyMCE dom be manipulated (offical API does not seem to work)?

Hope You can use fallowing

// Sets class attribute on all paragraphs in the active editor
tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select('p'), 'class', 'myclass');

// Sets class attribute on a specific element in the current page
tinymce.dom.setAttrib('mydiv', 'class', 'myclass');

or You can add Id by jquery like this

$('div').find('p').attr('id', 'myid');

Leave a Comment