I need to wrap an array of elements in a jQuery object, as if they were selected so that I could call them various jQuery actions.
I am looking for a function like foobelow that takes an array of elements and returns a jQuery object with them in it.
var elements = [element1, element2, element3];
$(foo(elements)).click(function() {
...
});
Can someone shed some light on this?
Many thanks.
source
share