[英]How to remove text selection that is highlighted when we copy to clipboard using javascript
我正在使用以下代碼使用javascript復制文本並將其粘貼到剪貼板。 它基本上選擇HTML元素,並在該特定元素上顯示突出顯示。 是否可以刪除熒光筆或其他任何方式來處理這種情況?
copyInputMessage(inputElement){
inputElement.select();
document.execCommand('copy');
inputElement.setSelectionRange(0, 0);
}
嘗試這個
copyInputMessage(inputElement){
inputElement.select();
document.execCommand('copy');
inputElement.setSelectionRange(0, 0);
inputElement.blur();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.