Blogger Information
Blog 19
fans 0
comment 0
visits 13303
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
JavaScript基础if语句练习 2019-03-25
倪偌卟離
Original
882 people have browsed it

实例

<!DOCTYPE html>
<html>
<head>
	<title>JavaScripe第一节课作业</title>
</head>
<body>
<script type="text/javascript">
	//判断是否为闰年
	var year=1996;
	if(year%4==0){
		alert('闰年');
	}else{
		alert('平年');
	}
	//判断成绩:给学生的具体成绩划分等级,优秀(90-100)、良好(80-89)、良(70-79)、及格(60-69)、不及格(0-59),输出该学生的成绩是哪个阶段
	var score= 70;
	if(score<=100 && score>=90){
		alert('成绩优秀');
	}else if(score<=89 && score>=80){
		alert('成绩良好');
	}else if(score<=79 && score>=70){
		alert('成绩良');
	}else if(score<=69 && score>=60){
		alert('成绩及格');

	}else{
		alert('成绩不及格');
	}
</script>
</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