jQuery append() – return appended elements

I’m using jQuery.append() to add some elements dynamically. Is there any way to get a jQuery collection or array of these newly inserted elements?

So I want to do this:

$("#myDiv").append(newHtml);
var newElementsAppended = // answer to the question I'm asking
newElementsAppended.effects("highlight", {}, 2000);

5 Answers
5

Leave a Comment