demo效果如下:
html代码部分如下:
js获取编辑框游标的位置#Div1, #Div2
{
width: 500px;
height: 100px;
border: solid 1px black;
}
插入字符
dasdsadasdasdasddasdasdasdasdsadsa
$('#ddddd').click(function(){
document.getElementById('test').focus();
insertHtmlAtCaret('');
})
function insertHtmlAtCaret(html) {
var sel, ra