BasicOIDC/assets/js/clipboard_utils.js

13 lines
246 B
JavaScript
Raw Permalink Normal View History

2022-04-19 08:10:05 +00:00
function copyToClipboard(str) {
const input = document.createElement("input");
input.value = str;
document.body.appendChild(input);
input.select();
input.setSelectionRange(0, str.length);
document.execCommand("copy");
input.remove();
}