Yes we can reverse list elements by jquery. Just store the list elements which is child of <ul> or <ol> tag in a javascript array variable by calling children() of jquery. and then iterate the array and append the DOM element in <ul> or <ol> tag.
ReversingList.html:
------------------------------------
<html>
<head><title>Reversing list elements by Jquery- anyforum.in</title></head>
<body>
<ul id="number-list">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
<button id="order">Change List Order- Click Here</button>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(´#order´).bind(´click´, function(){
var list=$(´#number-list´).children();
$(´#number-list´).html(´´);
for(var i=list.length-1;i>=0;i--){
$(´#number-list´).append($(list[i]));
}
});
</script>
</body>
</html>
Output:
-------------------------------
Change List Order- Click Here