📅  最后修改于: 2022-03-11 15:02:12.107000             🧑  作者: Mango
function getSelectionText() {
var text = "";
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type != "Control") {
text = document.selection.createRange().text;
}
return text;
}