<!DOCTYPE HTML>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>数组</title>
<script type="text/javascript">
var arr=['*','##','***','&&','****','##'];
arr[7]="**";
alter(arr.length);
document.write(arr[0]+"<br>"+arr[7]+"<br>"+arr[2]+"<br>"+arr[4])
</script>
</head>
<body>
</body>
</html>
1、alert你写成了alter;
2、document.write(arr[0]+"<br>"+arr[7]+"<br>"+arr[2]+"<br>"+arr[4]) 没加分号
alter(arr.length); 改成 alert(arr.length)