验证中...
gistfile1.txt
Raw Copy
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<p><input type="text" id="cj" placeholder="请输入成绩" /></p>
<p><input type="button" value="提交" onclick="fun()"/></p>
<p>成绩为: <span id="jg"></span></p>
<script type="text/javascript">
function fun () {
var x=document.getElementById("cj").value;
var jg=document.getElementById("jg");
switch (x=parseInt(x/10)){ /* 取十位数字parseInt(x/10)*/
case 6:
case 7:jg.innerHTML="成绩合格";
break;
case 8:jg.innerHTML="成绩良好";
break;
case 9:
case 10:jg.innerHTML="成绩优秀";
break;
default:jg.innerHTML="成绩不合格";
break;
}
}
</script>
</body>
</html>

Comment list( 0 )

You need to Sign in for post a comment

Help Search