為什么把alert換成document.write就行了???
<!DOCTYPE ?HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>數(shù)組</title>
<script type="text/javascript">
?//創(chuàng)建數(shù)組
?var arr=["*","##","***","&&","****","##*"];
?arr[7]="**";
?//顯示數(shù)組長度
?alert("數(shù)組的長度是:"+arr.length+"</br>");
?
?//將數(shù)組內(nèi)容輸出,完成達到的效果。
?document.write(arr[0]+"</br>");
?document.write(arr[7]+"</br>");
?document.write(arr[2]+"</br>");
?document.write(arr[4]+"</br>");
</script>
</head>
<body>
</body>
</html>
2016-04-21
2016-04-21
alert是 ?警告(消息對話框),性質(zhì)和write就不一樣啊,雖然都能輸出內(nèi)容,但是應用范圍不一樣。