JS获取当前月的天数

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> JS获取该月的天数 </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>
	<SCRIPT type="text/javascript">
	 function getDataMax(){
		var curDate = new Date();
		var year = parseInt(curDate.getFullYear());
		var month = parseInt(curDate.getMonth())+1;
		var date = new Date(year+'/'+month+'/0');
		alert('该月的天数为:'+date.getDate());
	 }
</SCRIPT>
 <body onload='getDataMax()'>
 </body>
</html>

你可能感兴趣的:(html,JS获取当前月的天数,JS获取月份天数,JS获取天数)