[jQuery] Re: Inserting element into jQuery object

2008-01-13 Thread besh
Hi Josh, don't try to reinvent the wheel here. Just use the jQuery a href=http://docs.jquery.com/Traversing/add#expr;.add()/a method. :) var $divs = $('div.first,div.second'); ... $divs = $divs.add('div.third'); -- Bohdan Ganicky On Jan 10, 8:32 pm, Josh Nathanson [EMAIL PROTECTED] wrote: I'm

[jQuery] Re: Inserting element into jQuery object

2008-01-13 Thread besh
Hi Josh, don't try to reinvent the wheel here. Just use the jQuery a href=http://docs.jquery.com/Traversing/add#expr;.add()/a method: var $divs = $('div#first,div#second'); ... $divs = $divs.add('div#third'); -- Bohdan Ganicky On Jan 10, 8:32 pm, Josh Nathanson [EMAIL PROTECTED] wrote: I'm

[jQuery] Re: Inserting element into jQuery object

2008-01-10 Thread Jonathan Sharp
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

[jQuery] Re: Inserting element into jQuery object

2008-01-10 Thread Josh Nathanson
: Inserting element into jQuery object 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

[jQuery] Re: Inserting element into jQuery object

2008-01-10 Thread Ariel Flesler
.   That's what was tripping me up. Thanks Jonathan! -- Josh   - Original Message -   From: Jonathan Sharp   To: jquery-en@googlegroups.com   Sent: Thursday, January 10, 2008 11:45 AM   Subject: [jQuery] Re: Inserting element into jQuery object   Hi Josh,   Most likely