Skip to content
Advertisement

How to fix this error (querySelector is used): Cannot read properties of undefined (reading ‘style’) at showSlides

I am unable to resolve this error; I’ve been “fighting” to solve it for two days.

This is the error:

215: Uncaught TypeError: Cannot read properties of undefined (reading ‘style’) at showSlides

enter image description here

JavaScript
JavaScript

I would not like there to be some setup problem regarding the querySelector or the function call. I need your help, help me please!

Advertisement

Answer

showSlides runs before the mySlides container is populated from outerXmlhttp

try calling showSlides from outerXmlhttp

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement