qq_我本非凡_1
2017-04-03 12:04
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系好安全带,准备启航</title>
<script type="text/javascript">
var d=new date;
var c=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
document.write(d.getFullYear()+"年"+d.getMonth()+"月"+d.getDate()+"日 "+c[d.getDay()]);
var b="小明:87;小花:81;小红:97;小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";
var e=b.spilt(";");
var sum=0;
for(var i=0;i<e.length;i++){
sum=sum+parseInt(e[i].substring(3,5));
}
document.write("--班级总分为:"+sum);
</script>
</head>
<body>
</body>
</html>
var e=b.spilt(";");的spilt改为split
var d = new Date();
JavaScript进阶篇
468060 学习 · 21891 问题
相似问题