I have the most basic example of an Electron app, with an index.html that has
<span id="foo"></span>
and also includes renderer.js via
<script src="./renderer.js"></script>
The problem is, when I try to change my DOM element from renderer.js:
var element = document.getElementById("foo")
console.log({element});
element.innerText = "123";
I get this error, and "element" is null:
Uncaught TypeError: Cannot set properties of null (setting 'innerText')
From my understanding, I'm not even using Electron features, I'm just using features that I could use in Chrome as well, so I don't get why this simple example won't work.