标签:body i++ set write win nload head utf-8 ext
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript">
var arr=[17,19,5,90,3];
window.onload=function(){
// alert(arr[0])
/var len=arr.length;
// alert(len);
for(var i=0;i<len;i++){
for( var j=i+1; j<len; j++){
if(arr[i]>arr[j]){
var temp=arr[i];
arr[i]=arr[j];
arr[j]=temp;
}
}
document.write(arr[i]);
document.write(",");
}
}
</script>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
标签:body i++ set write win nload head utf-8 ext
原文地址:http://www.cnblogs.com/lidepeng/p/6129033.html