ah, gotcha.
Who wrote the JS? did you create it on your own or are you using it from another source? Why at the end of the var’s does it have [0]
?
I know very little JS so won’t be able to help any further I don’t think. but [0]
could be just looking at the first instance of the matching element?