Code: HTML
<html>
<head>

<SCRIPT LANGUAGE="JavaScript">

function sortMultiDimensional(a,b)
{
    // this sorts the array using the second element   
    return ((a[1] < b[1]) ? -1 : ((a[1] > b[1]) ? 1 : 0));
}
</SCRIPT>
</head>

<body>
<script LANGUAGE="JavaScript">
var arr = [[4,8],[5,9],[2,10]]; // the multidimensional array
//arr.sort(); // normal sort
arr.sort(sortMultiDimensional); // sort using our custom function

for(var i=0;i<arr.length;i++)
{
    document.write(arr[i].toString()+"<br>");
}
</script>

</body>
</html>