How to use the value of an array as value of an attribute?

How to use the value of an array as value of an attribute?

Hello wizkids/ wizman of this forum,

I was wondering if I could use the vallue of an array as value for an attribute.

  1. var docus = ["#docu1", "#docu2", "#docu3", "#docu4", "#docu5", "#docu6", "#docu7", "#docu8"];
  2. var spots = ["100%", "300%", "600%", "600%", "600%", "700%", "800%", "900%"];

  3. for (var i = 0; i < docus.length; i++){
  4. docus[i].css({
  5. left: spots[i]
  6. });
  7. }

I have multiple pages and although I innitially wanted to make a function to add or subtract 100% of the left values. People on this website need to have the possibility to jump to a certain page.

I would love it if someone knows the solution, cause that would make my code so much cleaner, instead of using 20 variables and manipulating those one by one.

anyone thx for your responce!