Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

464
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda