Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

476
Views
In electron, why can I not access DOM elements from the renderer thread?

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!