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

227
Vistas
Uncaught TypeError: Cannot read properties of undefined (reading 'style') style.width="200px"
win.forEach(e=>{
        if((boxtexts[e[0]].innerText===boxtexts[e[1]].innerText) && (boxtexts[e[1]].innerText===boxtexts[e[2]].innerText) && (boxtexts[e[0]].innerText!=="")){
            document.querySelector('.info').innerText=boxtexts[e[0]].innerText+ " Won";
            isgameover=true
            document.querySelector(".gif").getElementsByClassName("gif")[0].style.width="200px"
        }
    })

Please let me know what wrong with this??

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Check the nesting. Whether it correct or not. I think there`s no such an element as "document.querySelector(".gif").getElementsByClassName("gif")[0]". U can console.log it to be sure it exists.

Furthermore, try not 2 querySelector, but try 2 use querySelectorAll if u have multiple items of this class. And after u get the array u can manipulate it choosing the concrete element in []. Regards.

about 4 years ago · Juan Pablo Isaza Denunciar

0

document.querySelector(".gif").getElementsByClassName("gif")[0] doesn't return any element. Your probably have a typo or something, hard to tell without your HTML code.

about 4 years ago · Juan Pablo Isaza Denunciar
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