var funGetSelectTxt = function() { var txt = ""; if(document.selection) { txt = document.selection.createRange().text; // IE } else { txt = document.getSelection(); } return txt.toString(); };
参考:
1.http://www.zhangxinxu.com/wordpress/?p=1428
2.http://www.ryanbay.com/?p=198