You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
323 B
16 lines
323 B
export function copyToClipboard(value) {
|
|
let result;
|
|
let copyTextarea = document.querySelector('#js-copytextarea');
|
|
|
|
document.getElementById('js-copytextarea').value = value;
|
|
copyTextarea.select();
|
|
|
|
try {
|
|
document.execCommand('copy');
|
|
result = 1;
|
|
} catch (err) {
|
|
result = 0;
|
|
}
|
|
|
|
return result;
|
|
};
|