I have a plugin that needs to return a different jQuery collection than the one it was passed. In other words, each of the elements passed in the original collection will create a new element, and I want to return the new elements instead of the originals.
So, instead of something like this: $.fn.myMethod = function() { return this.each(function() { // // Create new element here // }); which returns the original element collection (preserves chaining), I'm looking for an elegant way to return the new elements in a jQuery collection. I think maybe the $.map method might be part of the solution, but I'm afraid I just can't understand how. Any help would be appreciated. Thanks, Larry