Skip to content
Advertisement

Uncaught type error while using IIFE function

I’m new to Javascript.Trying to assign background images to div tag through this function:

JavaScript

Background image Style had been correctly mapped to each div of 6 div tags. However , there is uncaught error as below:

JavaScript

Anyone can help me understand what this error mean and how to resolve it?

Advertisement

Answer

Try to loop the queryselector object as the length of images array would me more than length of object returned from query selector

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