指导下啊啊
<script>
var mydate = new Date();
var myyear = mydate.getFullYear();
var mymonth = mydate.getMonth()+1;
var myday = mydate.getDate();
var myweek = mydate.getDay(); //获取数值0~6
var mynum = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];//0~6检索
var scoreStr = "小明:87;小花:81;小红:97;小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76";
var myarr = scoreStr.substring(3); //去除小明:字符串
var mysum = myarr.split(':'); //转为数组
var sum = 0;
var av =0;
for(var i=0;i<mysum.length;i++){
sum+=parseInt(mysum[i]);
}
av = sum/mysum.length;
av = Math.floor(av);
document.write(myyear+"年"+mymonth+"月"+myday+"日"+" "+mynum[myweek]+" "+"班级平均分数:"+av);
</script>