I said using Electron and trying to make the button collapse and close.
index.html
<button id="minus" onclick="minimize()">minimize</span></button> <button id="close" onclick="close()">close</span></button>
index.js
const remote = require('electron').remote; function minimize(){ var window = remote.getCurrentWindow(); window.minimize(); } function close(){ var window = remote.getCurrentWindow(); window.close(); }
I have to make some silly mistake or something, but the minimize button works fine while the close button doesn't work.
I also tried the EventListener method mentioned here by Atom Electron - Close the window using javascript And it works fine, but why doesn't my functional approach work?
javascript electron
shubh jaiswal
source share