Sorry for not being clearer; that's what comes from posting at 3 in the morning :P I was going on the post's title, attempting to use .after(). As Ricardo says, append/appendTo, prepend/prependTo work on newly created nodes, but after/insertAfter, and before/insertBefore require that the nodes be a part of the DOM.
Check out the docs, specifically the entries for the different methods, as they will tell you this and save you having to wait for responses in the forum :) http://docs.jquery.com/Manipulation On Feb 26, 12:42 pm, ricardobeat <ricardob...@gmail.com> wrote: > after() will insert elements 'after' the selected elements in the DOM. > If the element is not in the DOM, that is kind of 'outer space', there > is no 'after' it. Append and prepend should work just fine: > > $('<p>foo</p><p>bar</p>') > .append('<b>.test</b>') > .prepend('<span>test: </span>') > .appendTo('body'); > > http://jquery.nodnod.net/cases/75 > > cheers, > - ricardo > > On Feb 26, 8:33 am, stephen <stephen.cant...@gmail.com> wrote: > > > Hello, > > > has anybody managed to prepend and append elements to a set of dom > > elements previously created on the fly with the "$(html)" function? > > > I've tried with append, prepend, after, before, etc without any > > luck... > > > Is there a way to do it? > > > Stephen