Reverse Selected
Description
The following code shows how to use the built-in reverse-method to reverse array.
Example
<html>
<head>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {<!-- ww w . j a v a 2 s. c om-->
alert($("p").get().reverse());
});
</script>
</head>
<body>
<p>A</p>
<p>B</p>
</body>
</html>