[jQuery] Re: Insert new div into existing div

2007-06-12 Thread Brad Perkins
Excellent! And yes, chaining is great. I had tried chaining with append, but I now realize why that wasn't working (it was putting HTML into font-container and not subdiv). This combined with Franck's last example give me exactly what I need. Brad On Jun 12, 1:44 pm, George <[EMAIL PROTECTED]>

[jQuery] Re: Insert new div into existing div

2007-06-12 Thread George
Try this... $('').appendTo("#font-container").html("Lorem ipsum ...") Isn't chaining great?! George On Jun 12, 8:21 pm, Brad Perkins <[EMAIL PROTECTED]> wrote: > Thanks Franck! > > I had something working but that is more compact. > > Since I will need to place content into the inserted div I

[jQuery] Re: Insert new div into existing div

2007-06-12 Thread Franck Marcia
On 12 juin, 21:21, Brad Perkins <[EMAIL PROTECTED]> wrote: > var c = $("#font-container"); > c.append(''); > c.children("div:last-child").html("Lorem ipsum ..."); // get > the last inserted div > You could use an id and increment it each time you insert a child and then use this id directly. Som

[jQuery] Re: Insert new div into existing div

2007-06-12 Thread Brad Perkins
Thanks Franck! I had something working but that is more compact. Since I will need to place content into the inserted div I need to select the last inserted div. Using your suggestion, I've come up with something like: var c = $("#font-container"); c.append(''); c.children("div:last-child").htm

[jQuery] Re: Insert new div into existing div

2007-06-12 Thread Franck Marcia
This should work: $('#form_containter').append(''); then $('#form_containter').append(''); and so on... Franck. On 12 juin, 18:39, Brad Perkins <[EMAIL PROTECTED]> wrote: > In looking at the DOM manipulation commands I'm not clear on the best > way to insert a div into an existing div. More sp