a jQuery object is not a real array. The add() function does what you
want:

var foobar = $('.foo').add('.bar');

If you want to add elements manually use:

var $foo = $('.foo');
$foo[ ++$foo.length ] = $('.bar')[0];

- ricardo

On Sep 23, 4:35 pm, "~flow" <[EMAIL PROTECTED]> wrote:
> i seem to remember i asked this question before, but am unable to
> retrieve that post---given a jQuery object with a collection of DOM
> nodes, how can i append another DOM node (like `[].push()` would do)
> to that collection without breaking object identity? i need
>
>   var t = $( '.foo' );
>   var s = t;
>   t.push( '.bar' ); // should now like like $( '.foo,.bar' )
>   assert( s === t, 'object identity broken' )
>
> any ideas what to write for `$().push`?
>
> cheers & ~flow

Reply via email to