electron/docs/fiddles/native-ui/dialogs/open-file-or-directory/renderer.js

7 lines
258 B
JavaScript
Raw Normal View History

2020-08-27 08:31:51 -06:00
const selectDirBtn = document.getElementById('select-directory')
selectDirBtn.addEventListener('click', async () => {
const path = await window.electronAPI.openFileDialog()
2020-08-27 08:31:51 -06:00
document.getElementById('selected-file').innerHTML = `You selected: ${path}`
})