Skip to content

Instantly share code, notes, and snippets.

@jlittlejohn
Created September 10, 2014 16:44
Show Gist options
  • Select an option

  • Save jlittlejohn/249899c462b9676a7fb8 to your computer and use it in GitHub Desktop.

Select an option

Save jlittlejohn/249899c462b9676a7fb8 to your computer and use it in GitHub Desktop.
JS: Reverse the Order of a List
(function () {
var ulList = $("#ulList"),
liArray = ulList.children('li'),
reversedList = $(liArray).get().reverse();
$(ulList).prepend(reversedList);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment