ec87917f58
* docs: add clipboard paste Fiddle example * docs: add clipboard copy Fiddle example * docs: add appropriate title to Fiddles Co-Authored-By: John Kleinschmidt <jkleinsc@github.com>
10 lines
345 B
JavaScript
10 lines
345 B
JavaScript
const { clipboard } = require('electron')
|
|
|
|
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.'
|
|
clipboard.writeText('Electron Demo!')
|
|
})
|