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

223
Views
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 answers
Answer question

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 Report

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 Report
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!