⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 23.htm

📁 介绍了javascript的常用的函数
💻 HTM
字号:
<html>
<head>
<title>全中文日期显示</title>
</head>
<body>
<script language="javascript">
<!--
	str = new Array("零","一","二","三","四","五","六","七","八","九");
	function number(num){
		tostr = "" + num;
		if(num < 10 ){
			return str[num];
		}else if(num == 10){
			return "十";
		}else if(num < 20){
			return "十" + str[tostr.charAt(1)];
		}else if(num == 20){
			return "二十";
		}else if(num <30){
			return "二十" + str[tostr.charAt(1)];
		}else if(num == 30){
			return "三十";
		}else if(num > 30){
			return "三十" + str[tostr.charAt(1)];
		}
	}
	
	d = new Date();
	year  = ""+d.getYear();
	month = d.getMonth() + 1;
	date  = d.getDate();
	document.write(str[year.charAt(0)]+str[year.charAt(1)]+
				   str[year.charAt(2)]+str[year.charAt(3)]+"年");
	document.write(number(month)+"月"+number(date)+"日");
//-->
</script>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -