This is just a follow up to my previous post on the same topic. In my comments, I had mentioned that after I wrote my attrList() jQuery plugin, someone pointed out to me that the same thing was doable using an array and the jQuery mapping function (which maps an array to a function). Someone then contacted me, asking about it, so I thought I would post up the same demo, except this time, instead of building a value list string as I iterate through the jQuery stack elements, I am going to be building up an array. Then, once I have completely gone through the elements, I will simply join the array using the given delimiter.
Clicking on the button properly alerts the value list:
I chose not to use the jQuery $.map() method, since the each() method does pretty much the same exact thing.
Want to use code from this post? Check out the license.