I'm new to jquery and I have a page with multiple unordered lists ul. I need to reverse order each ul, I saw this answer jQuery reversing the order of child elements but it messes all items with all lists. I tried to change the code to fit my needs but it doesn't do what I want, I can access each li of each ul but I don't know how to reverse the order of the li items.
My code:
$(function() {
ul = $('ul'); // your parent element
ul.each(function(i,ul){
$(this).children().each(function (i,li) {
alert(i);/*i got to do something here*/
});
})
});