JavaScript
Article

jQuery reverse array of DOM elements

By Sam Deering

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() { /* ... */ });
  • gmilby

    interesting :)

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in JavaScript, once a week, for free.