просто для примера )))
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div id="test" onclick="children_reverse(this)" style="background-color: #FF0000; color: #FFFFFF" >кликни
<p id='ms1'>1</p>
<p id='ms2'>2</p>
<p id='ms3'>3</p>
<p id='ms4'>4</p>
<p id='ms5'>5</p>
</div>
<script language="JavaScript" type="text/javascript">
function children_reverse(node) {
node = typeof node == "string" ? document.getElementById(node) : node;
var children = node.children
var fragment = document.createDocumentFragment()
for (var i = children.length - 1; i >= 0; i--) {
fragment.appendChild(children[i])
}
node.appendChild(fragment)
}
</script>
</body>
</html>