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

144
Vistas
JS: Variable declared with let, but got "undefined" Error when calling it

Sorry if this question is stupid, I am normally not doing any frontend stuff and am kind of a noob with JS.

In Firefox DevTools I see the following error message:

Uncaught TypeError: tabHeader is undefined

I have the following code:

let tabHeader=document.getElementsByClassName('tab-header')[0];

let tabsPane=tabHeader.getElementsByTagName('div');

I declared one variable using let, but it still gets read as "undefined"; Further more, if I use consol.log(tabHeader) I also get undefined as output in the console. I am sure this is easy and I am just being a noob, but what am I doing wrong here?

about 4 years ago · Santiago Trujillo
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