更新时间:2023-02-11 14:43:06
您可以使用以下代码获取mouseup事件中的选定文本:
You can get the selected text on the mouseup event with some code like this:
$(document).mouseup(function (event) {
var text = document.selection.createRange().text;
if (text != "") {
//Use text in popup, etc... SAMPLE:
alert(text);
}
});