jQuery: Get last added (or appended) element.

May 13th, 2009 by jeremychone
var lastAddedElement = $("#myDiv").append("Cool link").find(":last");

The $.fn.append method returns the selected element and not the added one (this is to allow chaining)

Leave a Reply