Blogger Information
Blog 12
fans 0
comment 4
visits 9516
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Javascript第一篇——判断if else
温度的博客
Original
695 people have browsed it
//获取当前时间  国际0是一月,十一月是十二月。
	var myday = new Date();
	document.write(myday.getFullYear()+"年");
	var month = new Array();
		month[0] = '一月';
		month[1] = '二月';
		month[2] = '三月';
		month[3] = '四月';
		month[4] = '五月';
		month[5] = '六月';
		month[6] = '七月';
		month[7] = '八月';
		month[8] = '九月';
		month[9] = '十月';
		month[10] = '十一月';
		month[11] = '十二月';
	document.write(month[myday.getMonth()]);
	document.write(myday.getDate()+"日");
	document.write(myday.getHours()+"时");
	document.write(myday.getMinutes()+"分");
	document.write(myday.getSeconds()+"秒");
	document.write("星期"+myday.getDay());

	var year = 2018;
	if(year%400 ==0 || (year%4 ==0 && year%100 !=0)){
		document.write(year+'是闰年');
	}else{
		document.write(year+'是平年');
	}
	
	document.write("<br><br><br><br><br>");
	//给学生的具体成绩划分等级
	var mark = 89;
	if(mark>=90 && mark<=100){
		document.write(mark+'分,优秀哦');
	}else if(mark >=80 && mark<=89){
		document.write(mark+'分,良好');
	}else if(mark >=70 && mark<=79){
		document.write(mark+'分,良');
	}else if(mark >=60 && mark<=69){
		document.write(mark+'分,及格');
	}else{
		document.write(mark+'分,不及格');
	}


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
1 comments
灭绝师太 2019-03-26 16:41:35
有自己学习vip,很棒!继续加油!
1 floor
Author's latest blog post