Created
January 22, 2017 09:40
-
-
Save Kcko/41668319482abf58a1fd8eae6d0ea7d9 to your computer and use it in GitHub Desktop.
jQuery - reverse each
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function(){ | |
| var reversedSet = $("li").get().reverse(); | |
| //Use get() to return an array of elements, and then reverse it | |
| $(reversedSet).each(function(){ | |
| //Now we can plug our reversed set right into the each function. Could it be easier? | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment