js clear copy
window.getSelection().empty() & window.getSelection().removeAllRanges() & document.selection.empty()
https://stackoverflow.com/questions/3169786/clear-text-selection-with-javascript
https://developer.mozilla.org/en-US/docs/Web/API/Selection
if (window.getSelection) {
if (window.getSelection().empty) { // Chrome
window.getSelection().empty();
} else if (window.getSelection().removeAllRanges) { // Firefox
window.getSelection().removeAllRanges();
}
} else if (document.selection) { // IE?
document.selection.empty();
}
Chrome 79~82
https://www.cnblogs.com/xgqfrms/p/12275284.html
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!