Blogger Information
Blog 17
fans 1
comment 1
visits 16499
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
判断成绩好坏
雷国恩的博客
Original
1116 people have browsed it

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>	</title>
  <style type="text/css">
  	.box{width:310px;height:150px;border:1px solid red;margin:100px auto;padding:10px;}
  	h2{width:250px;height:20px;display: block;line-height: 20px;margin:0 auto;text-align:center;}
  </style>

  <script type="text/javascript">
     var number,text,jieguo;
  	 window.onload=function(){
  	 	text=document.getElementById('text');

  	 	jieguo=document.getElementById('jieguo');

  	 	}

  	 	function jisuan(){
  	 		var a=Number(text.value);
  	 		if(typeof(a)=="number"){
  	 			if(!isNaN(a)){
  	 				if(a>=90 ){	
	  	 				jieguo.innerHTML=a+"优秀";
	  	 			}else if(a>=80){
		  	 			jieguo.innerHTML=a+"良好";
		  	 		}else if(a>=79){
		  	 			jieguo.innerHTML=a+"一般";
		  	 		}else if(a>=60){
		  	 			jieguo.innerHMTL=a+"及格";
		  	 		}else{
		  	 			jieguo.innerHTML=a+"要努力呀";
		  	 		}
  	 			}else{		
  	 				jieguo.innerHTML="你输入的不是数字,请重新输入";
  	 			}	
  	 			
  	 		}
  	 		
        	
  	 }

  </script>
</head>
<body>
	<div class="box">
		<h2>判断成绩</h2><br>
		<span>请输入成绩:</span>
		<input id="text" type="text" value=""><input type="button" onclick="jisuan();" value="判断"><br>
		<span id="jieguo"></span>
	</div>
</body>
		
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post