复制代码 代码如下:
function getselectedtext() { //this function code is borrowed from: http://www.codetoad.com/javascript_get_selected_text.asp
var txt = ;
if (window.getselection) {
txt = window.getselection();
} else if (window.document.getselection) {
txt = window.document.getselection();
} else if (window.document.selection) {
txt = window.document.selection.createrange().text;
}
return txt;
}
