Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
TinyMCE エディタで「p」を削除すると、次のコードのようになります。
すべてを削除する方法???
tinyMCE.activeEditor.dom.remove(tinyMCE.activeEditor.dom.select('p'));
これを試して:
tinyMCE.activeEditor.setContent('');
setContent リファレンス
段落のみが削除されるようにするには、次を使用します。
$(tinymce.activeEditor.getBody()).find('p').remove();
ユーザーが最初にクリックしたtinymce.activeEditorときに設定されるため、明示的なエディター インスタンス (ユーザーがエディターをクリックする前でも使用可能) を使用することをお勧めします。それを使用するには:
tinymce.activeEditor
tinymce.get('your_editor_id');