<DOCTYPE!>
<html>
<head>
<title>js内置对象练习</title>
<meta charset="utf-8">
<script>
var mydate=new Date();
var weekday=["星期天","星期一","星期二","星期三","星期四","星期五","星期六"];
var month=mydate.getMonth()+1;
document.write("今天是:"+mydate.getFullYear()+"年"+month+"月"+mydate.getDate()+"日"+weekday[mydate.getDay()]+"<br/>");
var score="小明:87; 小花:81; 小红:97; 小天:76;小张:74;小小:94;小西:90;小伍:76;小迪:64;小曼:76"
var myarr=score.split(";")
var sum=0;
for(i=0;i<myarr.length-1;i++){
sum+=parseInt(myarr[i].split(":")[1]);
}
document.write("班级总分数是"+sum+"<br/>");
document.write("平均分数:"+Math.round(sum/myarr.length));
</script>
</head>
<body>
</body>
</html>
热门评论
添加评论的功能用到了ajax局部刷新技术
添加评论的功能用到了ajax局部刷新技术
,,,,,,,,,,,,