sel = window.getSelection();
range = sel.getRangeAt(0);
range.deleteContents();
if (window.getSelection)
{ if (sel.getRangeAt && sel.rangeCount)
{ var el = document.createElement("div");
el.innerHTML = "内容";
range.insertNode(frag); }
// 标签在为后边的时候光标位置bug,在父元素parentNode最后边添加空的占位符
parentNode.appendChild(document.createTextNode('u200B'))