答案 0 :(得分:0)
你可以尝试:
document.getSelection()
var text = '';
if (window.getSelection)
{
text = window.getSelection();
}
else if (document.getSelection)
{
text = document.getSelection();
}
else if (document.selection)
{
text = document.selection.createRange().text;
}
else return;