jQuery: Append child element before child element
问题 I have an HTML code like this: <div id="content"> <div class="foobar"></div> </div> I want to append child elements inside div#content before the div.foobar element. How can do that? 回答1: Before I answer your question let me make something more clearer and easier to u so that you understand what your trying to Append means you can insert elements as child elements at the end of the selector example append() and appendTo() Prepend means you can insert elements as child elements at the