Hi Josh,

Most likely you'll have to create a new jQuery object. Take a look at the
slice method to grab your elements:
var divs = $('selector'); // [div1, div2]
var divs = $( [ divs.slice(0, 1), newdiv, divs.slice(1, 2) ] );
// divs = [div1, newdiv, div2]

Cheers,
-Jonathan


On 1/10/08, Josh Nathanson <[EMAIL PROTECTED]> wrote:
>
>
> I'm having a devil of a time doing something that would seem to be pretty
> basic.
>
> I have a jQuery object with two elements, and I want to insert a new
> element
> in between them - not altering the DOM, but just the jQuery object.
>
> So if my original jQuery object looks like this when logged in the
> console:
> [ div1, div2 ]
>
> I want it ultimately to look like this, inserting newdiv manually:
> [ div1, newdiv, div2 ]
>
> ?????
>
> -- Josh
>
>
>

Reply via email to