我在 textarea/tinyMCE 编辑器中有以下内容(我的 textarea 的 id 是“通知”:
<div ...>
some contents here
</div>
<div id="myDiv">
Require to be updated from jQuery function
</div>
<div...> other div </div>
我可以在 div 元素中放一些内容:(特别是以下 div):
<div id="myDiv"></div>
如果光标在“myDiv”内闪烁,我可以将内容放在这里,代码如下:
tinyMCE.activeEditor.execCommand('mceInsertContent', false, parties);
在以下带有按钮 onclick 事件的 javascript 函数中使用上述内容:
function insert_contents(someContents){
try {
tinyMCE.activeEditor.execCommand('mceInsertContent', false, someContents);
} catch (e) {
alert(e.message);
}//catch
}//end function
我的问题:我是否可以在“myDiv”div 元素中放置一些内容,并且如果需要删除它也可以从“myDiv”div 中删除相同的内容,而无需在“myDiv”内单击鼠标?问候