重置TinyMCE框

Roc*_*ngh 13 javascript asp.net jquery tinymce

我正在使用TinyMCE编辑器.我想在我的表单上点击一些按钮,清除编辑框内的内容.

你能告诉我怎么做吗?

Tha*_*ama 24

这可以很容易地完成(不需要使用缓慢的jQuery tinymce构建)使用以下代码作为按钮的onclick-action:

// 'content' is tinymce default,
// but if your textarea got an ID that is the one you need!
var my_editor_id = 'content';

// set the content empty
tinymce.get(my_editor_id).setContent(''); 
Run Code Online (Sandbox Code Playgroud)