I recently completed a fresh electron application.
The application is made up of the following files:
index.html
main.js
renderer.js
Inside the index.html file, I included a button with an onclick event:
<button onclick="myfunction()">Call Function</button>
The function associated with the button is a simple alert for testing purposes:
myfunction() {
alert('I am the js function');
}
However, I encountered an issue where I added the function code in both the renderer.js file and at the end of main.js, yet when I click the button, the alert does not appear.
Is there a way for me to ensure that js functions are called correctly from the index.html file?