Reputation: 147
In TinyMCE Editor,when you remove "p", just like the following code.
How to remove all ???
tinyMCE.activeEditor.dom.remove(tinyMCE.activeEditor.dom.select('p'));
Upvotes: 3
Views: 4373
Reputation: 401
If you have multiple instances of tinymce textareas in the same page, you might use:
tinyMCE.get('your-textarea-id').setContent('');
Upvotes: 0
Reputation: 50832
To be sure only paragraphs get deleted use:
$(tinymce.activeEditor.getBody()).find('p').remove();
Due to the fact that tinymce.activeEditor
gets set the first time when a user clicks in it it might be a better choice to use the explicit editor instance (which is available even before a user clicks into the editor). To get it use:
tinymce.get('your_editor_id');
Upvotes: 1