$('#id') .add(myJQObj) .add(myotherJQObj) .hide()
On Feb 24, 8:51 am, Bisbo <michael.waterf...@googlemail.com> wrote: > Hi there, > > I can't seem to find a way to perform the same jQuery method on > multiple jQuery objects. I have tried using commas and passing arrays > to the jQuery function but neither works. > > $( $('#id') , myJQObj ).hide(); > $( [ $('#id') , myJQObj ] ).hide(); > > I know you can do this within a selector, i.e. $('#id, .hello').hide > (), but I already have a few jQuery objects passed from various places > and I need to perform the same action on each of them. > > There must be a way to do this, can anyone point me in the right > direction as I can't see any way of doing this in the documentation! > > Many thanks, > > Michael