TinyMCE:将光标移动到插入文本的末尾
TinyMCE: Move cursor to end of inserted text
我在 TinyMCE 中插入了一个换行符
tinyMCE.execCommand('mceInsertContent',false, "<br/>");
但是光标当前停留在之前的位置..这是有道理的,但是我想要将光标移动到我刚刚插入的 html 末尾的代码?
在 <br/>
后添加 space 将重新定位光标:
所以改变:
tinyMCE.execCommand('mceInsertContent',false, "<br/>");
到
tinyMCE.execCommand('mceInsertContent',false, "<br/> ");
示例:http://codepen.io/anon/pen/PbKQpJ(编辑器上方的演示链接)
我在 TinyMCE 中插入了一个换行符
tinyMCE.execCommand('mceInsertContent',false, "<br/>");
但是光标当前停留在之前的位置..这是有道理的,但是我想要将光标移动到我刚刚插入的 html 末尾的代码?
在 <br/>
后添加 space 将重新定位光标:
所以改变:
tinyMCE.execCommand('mceInsertContent',false, "<br/>");
到
tinyMCE.execCommand('mceInsertContent',false, "<br/> ");
示例:http://codepen.io/anon/pen/PbKQpJ(编辑器上方的演示链接)