Using .each to loop through elements
I am trying to get elements into an array from a common ID. This is my .each loop:
- $('*[id^="totalPrice"]').each(function() {
And this is my elements that I want to loop through:
- <span id='totalPrice".$id."'>
When I loop through, I only get one element returned. With the listing, there are 3 elements. Why is it not getting to the other two?