JavaScript
Article

jquery .each backwards (reverse it)

By Sam Deering

Quick jQuery snippet to reverse each to loop over elements backwards. Example shows effect on loop over a list backwards.

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

No Reader comments

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