10 lines
244 B
JavaScript
10 lines
244 B
JavaScript
|
|
||
|
function copyText(text) {
|
||
|
try {
|
||
|
navigator.clipboard.writeText(text);
|
||
|
console.log('Content copied to clipboard: "' + text + '"');
|
||
|
} catch (error) {
|
||
|
console.error('Failed to copy "' + text + '":', error);
|
||
|
}
|
||
|
}
|