<div id="aa">就是个demo<div>
<script language="javaScript">
    var div = document.getElementById("aa");
    div.onmouseup = function () {
        var userSelection;
        if (window.getSelection) {
            // 现代浏览器
            userSelection = window.getSelection();
            userSelection.getRangeAt(0).deleteContents();
            userSelection.getRangeAt(0).insertNode(document.createTextNode('text'));
        } else if (document.selection) {
            // IE浏览器 
            userSelection = document.selection.createRange();
            userSelection.text = 'test'
        }
    };
</script>多看下api,楼主,IE的selection和标准浏览器接口不一样:selection对象中文API