diff --git a/wwwroot/js/site.js b/wwwroot/js/site.js index f0cb619..6cd0264 100644 --- a/wwwroot/js/site.js +++ b/wwwroot/js/site.js @@ -3,16 +3,8 @@ // Write your JavaScript code. -function copyToClipboard(field) { - let textarea = document.createElement('textarea'); - textarea.id = 't'; - textarea.style.height = "0"; - document.body.appendChild(textarea); - textarea.value = field; - let selector = document.querySelector('#t'); - selector.select(); - document.execCommand('copy'); - document.body.removeChild(textarea); +function copyToClipboard(str) { + navigator.clipboard.writeText(str); } $(document).ready(function() {