我在tinymce编辑器中有一个文本框。我想使用javascript更改文本框文本。
谁能告诉我这怎么可能?
谢谢
最佳答案
使用tinymce setContent方法,希望对您有所帮助。
// Sets the HTML contents of the activeEditor editor
tinyMCE.activeEditor.setContent('<span>some</span> html');
// Sets the raw contents of the activeEditor editor
tinyMCE.activeEditor.setContent('<span>some</span> html', {format : 'raw'});
// Sets the content of a specific editor (my_editor in this example)
tinyMCE.get('my_editor').setContent(data);
// Sets the bbcode contents of the activeEditor editor if the bbcode plugin was added
tinyMCE.activeEditor.setContent('[b]some[/b] html', {format : 'bbcode'});
请检查tinymce文档http://www.tinymce.com/wiki.php/API3:method.tinymce.Editor.setContent