I'm new to Javascript and I'm trying to create a simple ElectronJS app. However, I can't get external scripts to work. It should be added that both files are in the same folder (as are all of the application files). What am I missing here?
This works:
main.html
<head>
<script>
function color_red() {
document.getElementById("collectBtn").style.color = "red";
}
</script>
</head>
<body>
<button id="collectBtn" onclick="color_red()">Color me!</button>
</body>
This does not:
connect.js
function color_red() {
document.getElementById("collectBtn").style.color = "red";
}
main.html
<head>
<script src="connect.js"></script>
</head>
<body>
<button id="collectBtn" onclick="color_red()">Color me!</button>
</body>