Is there anyway to add same animation to every element of same class instead of specifying for individual elements ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Is there anyway to add same animation to every element of same class instead of specifying for individual elements ?

So can it be a.style just ,instead of a[0] and a[1]? https://code.sololearn.com/WPHClrkufJ3o/?ref=app

4th Jun 2020, 10:36 PM
Abhay
Abhay - avatar
2 Answers
+ 3
5th Jun 2020, 7:01 AM
Abhay
Abhay - avatar
+ 1
Mirielle, QuerySelectorAll() returns a nodelist object, and while it does have a forEach method, it is not an array. You will have to convert the nodelist to an array to use the other array methods. https://developer.mozilla.org/en-US/docs/Web/API/NodeList.
5th Jun 2020, 2:13 AM
ODLNT
ODLNT - avatar