Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<script language="jscript">
function reorder(listName, order) {
var oHid_Order = document.getElementById("hid_" + listName + "_order");
if (oHid_Order.value == order) {
// Nothing to do : the order is allready good
return;
} else {
oHid_Order.value = order;
var oTable = document.getElementById(listName);
var nbRows = oTable.children.length;
var firstNode = oTable.children(0); // the first node will be reference.
for (var i=1; i<nbRows; i++) {
// What we are doing : get last row, delete it
// and recreate it before reference node
var curNode = oTable.children(nbRows-1);
curNode.removeNode(true);
oTable.insertBefore(curNode, firstNode);
}
}
}
</script>
</head>
<body>
<input id="hid_list1_order" type="text" value="asc" />
<input type="button" value="sort asc." onclick="reorder('list1', 'asc');" />
<input type="button" value="sort desc." onclick="reorder('list1', 'desc');" />
<table>
<tbody ID="list1">
<tr>
<td>Value 1</td>
</tr>
<tr>
<td>Value 2</td>
</tr>
<tr>
<td>Value 3</td>
</tr>
<tr>
<td>Value 4</td>
</tr>
<tr>
<td>Value 5</td>
</tr>
</tbody>
</table>
</body>
</html>