Copy the code code as follows:
<html>
<head>
<title>Sort of array</title>
<script>
var arr = [2,4,9,11,6,3,88];
//Adopt bubble sorting, bubble upward, and the minimum value is at the top
for(var x = 0; x < arr.length; x++){//Control the number of passes
for(var y = x + 1; y < arr.length; y++){
//Compare in sequence, if the following element is greater than the previous element, exchange it
if(arr[x] > arr[y]){
var temp = arr[x];
arr[x] = arr[y];
arr[y] = temp;
}
}
}
document.write(arr);
</script>
</head>
<body>
<div id="time"></div>
</body>
</html>