获取突出显示的/选定的文本是否有可能在网站的一个段落中得到突出显示的文本,例如使用jQuery?
3 回答

白衣非少年
TA贡献1155条经验 获得超0个赞
window.getSelection().toString()
document.selection.createRange().htmlText

猛跑小猪
TA贡献1858条经验 获得超8个赞
window.getSelection().anchorNode.textContent.substring( window.getSelection().extentOffset, window.getSelection().anchorOffset)
添加回答
举报
0/150
提交
取消