为啥sum输出为NAN?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
var d = new Date();
var m = d.getMonth() + 1;
var str = "星期" + "日一二三四五六".charAt(new Date().getDay());
document.write(d.getFullYear() + "年" + m + "月" + d.getDate() + "日" + " " + str);
// setTimeout("open(location, '_self').close();", 3000);
var c = "小明:87; 小花:81; 小红:97; 小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";
var s = new Array();
s = c.split(";");
var sum = 0;
for (var i = 0; i < s.length; i++) {
sum = sum + parseInt(s[i].substr(3));
}
document.write("<br>" + "班级总分为:" + sum);
</script>
</head>
<body>
</body>
</html>