Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

237
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda