js clear copy
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 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/12275337.html
未经授权禁止转载,违者必究!