electron/docs/fiddles/system/clipboard/copy/renderer.js
2023-04-24 10:35:14 -04:00

8 lines
309 B
JavaScript

const copyBtn = document.getElementById('copy-to')
const copyInput = document.getElementById('copy-to-input')
copyBtn.addEventListener('click', () => {
if (copyInput.value !== '') copyInput.value = ''
copyInput.placeholder = 'Copied! Paste here to see.'
window.clipboard.writeText('Electron Demo!')
})