<html>
<head>
<title>test</title>
<meta charset="utf-8">
</head>
<body>
<script >
var arr=[9,87,25,36,89,14,51,19,63];
var n=arr.length;
while(n){
for(i=0; i<n-1; i++){
if(arr[i]>arr[i+1]){
temp=arr[i];
arr[i]=arr[i+1];
arr[i+1]=temp;
}
}
n=n-1;
}
alert(arr);
</script>
</body>
</html>