Hi i'm relatively new to coding, particularly in Electron. I've organized my project into different folders with various files. When I use a live server, everything functions correctly. However, upon starting the code with 'npm run start' a specific part fails to work properly. I'm attempting to change the color with a click using the function change_color(), but unfortunately, it's not working as intended.
# Karteikarten.html
function change_color() {
const karteikartenElement = document.querySelector('.Karteikarten');
karteikartenElement.style.backgroundColor = 'lightblue';
}
# Ergänzung.js
<div class="Karteikarten" onclick="change_color()">
<p>Karteikarten</p>
</div>
Folderstructure
I need an explanation:)