From 584cb7f8e062a1916251091a57dfb7dd74c8eb0e Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 28 Mar 2015 14:46:54 +0100 Subject: [PATCH] appendTo/prependTo: correct note about appending multiple elements --- entries/appendTo.xml | 2 +- entries/prependTo.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/entries/appendTo.xml b/entries/appendTo.xml index f3e5da64..562b870d 100644 --- a/entries/appendTo.xml +++ b/entries/appendTo.xml @@ -53,7 +53,7 @@ $( "h2" ).appendTo( $( ".container" ) ); <h2>Greetings</h2> </div> -

If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first, and that new set (the original element plus clones) is returned.

+

If there is more than one target element, however, cloned copies of the inserted element will be created for each target except the last, and that new set (the original element plus clones) is returned.

Before jQuery 1.9, the append-to-single-element case did not create a new set, but instead returned the original set which made it difficult to use the .end() method reliably when being used with an unknown number of elements.

diff --git a/entries/prependTo.xml b/entries/prependTo.xml index f51db248..5a8c66df 100644 --- a/entries/prependTo.xml +++ b/entries/prependTo.xml @@ -53,7 +53,7 @@ $( "h2" ).prependTo( $( ".container" ) ); <div class="inner">Goodbye</div> </div> -

If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first.

+

If there is more than one target element, however, cloned copies of the inserted element will be created for each target except the last.