直接上代码吧,用js控制在光标位置插入。 在实现表情的插入时用到了。 代码如下: <span xss=removed><html> <head> [removed] function test(str){ var tc = document.getElementById(“mytextarea”); var tclen = tc.value.length; tc.focus(); if(typeof document.selection != “undefined”) { document.selection.createR