jQuery reverse array of DOM elements

Sam Deering
Share

Quick jQuery code snippet a bit like jQuery.each backwards I suppose. Could come in handy to loop through elements backwards.

$($("li").get().reverse()).each(function() { /* ... */ });