- export default function copyToClipboard(content: string) {
- const input = document.createElement('input')
- input.style.position = 'fixed'
- input.style.left = '9999px'
- input.value = content
- document.body.appendChild(input)
- input.select()
- document.execCommand('copy')
- document.body.removeChild(input)
- }
|