When I do $('#conatiner1 span') on my page, it returns an array with 11 span elements.
I also have an array ‘vals’ with 11 different values.
Is there a fast ‘do more, write less’ jquery command to easily assign each value of val to each span element?
span 1 -> val 1;
span 2 -> val 2;
span 3 -> ...
Yes, take a look at jquery each methods. There are few of them and all of them are passing element index to your handler function.
For example, if you store text in values which you want to put into those spans: