Skip to content
Advertisement

Js .classList.add() is not working properly

I’m in a procces of creaing simple movie site. cruntly working there home page. in the home page there is a carosol.

in CSS I hidden the visibility of all slide. what I’m going do is in JS creat a array for all silds and switch between silds when I clicked the arrow icon.

as a first stem I want to active 1st slide when we load the web. so I used .classList.add() property to active 1st element of the array. but it’s not work propaly.

please help to short this out.

JavaScript
JavaScript
JavaScript

Advertisement

Answer

Try this

JavaScript

This (…) is called spread operator it gives you the elements of an array

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