函数如下
scriptlanguage=;javascript;;
functiongetLevel(score){
if(isNaN(score)score0score;100)return;error;;
vartempScore=parseInt(score)/10;
switch(tempScore){
case10:return;优;;
case9:return;优;;
case8:return;良;;
case7:return;一般;;
case6:return;及格;;
default:return;不及格;;
}
}
alert(getLevel(50.5));
/script;