Html 取得鼠标选择的文本
function _getSelectedText() {
if (window.getSelection) {
var sel = window.getSelection();
if (sel.rangeCount > 0) {
var range = sel.getRangeAt(0);
return range;
}
} else {
var range = document.selection.createRange();
return range.text;
}
}
return "";
}
if (window.getSelection) {
var sel = window.getSelection();
if (sel.rangeCount > 0) {
var range = sel.getRangeAt(0);
return range;
}
} else {
var range = document.selection.createRange();
return range.text;
}
}
return "";
}