Perhaps the documentation should also be fixed to note that .append actually accepts multiple arguments to append, not just one.
One of the comments in that ticket was that he could not use: var form = $( '<form/>' ); form.append( $( "<input type='radio'" ).attr( 'value','1' ).after( $( '<label/>' ).text('true') ) .after( $( "<input type='radio'" ).attr( 'value','0' ).after( $( '<label/>' ).text('false') ) ) ); Truth is that statement could have been written (and perhaps cleaner) by using a multi-arg .append rather than .after; var form = $('<form/>').append( $('<input type=radio>').attr('value', 1), $('<label/>').text('true'), $('<input type=radio>').attr('value', 0), $('<label/>').text('false') ); Of course an .append(...).append(...); would work as well. ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://nadir-seen-fire.com] -Nadir-Point (http://nadir-point.com) -Wiki-Tools (http://wiki-tools.com) -MonkeyScript (http://monkeyscript.nadir-point.com) -Animepedia (http://anime.wikia.com) -Narutopedia (http://naruto.wikia.com) -Soul Eater Wiki (http://souleater.wikia.com) John Resig wrote: > Yeah, this is really just a documentation issue. Do you want to just > tweak the docs for those entries and be sure to mention that they > require that the element(s) are already inserted in to a document or > another node? > > --John > > > > On Tue, Feb 17, 2009 at 10:59 PM, Dave Methvin <dave.meth...@gmail.com> wrote: > >> The before/after/insertBefore/insertAfter methods require a parentNode >> so that the content can be inserted relative to the element. So, $ >> ("<p>unusual</p>").after("<p>case</p>") will fail. >> >> http://dev.jquery.com/ticket/3940 >> >> Maybe that should just be documented? There are plenty of other ways >> to solve the problem. >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---