标签:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript">
//定义函数
function isLeapYear(year)
{
//判断闰年的条件
if((year%4==0)&&(year%100!=0)||(year%400==0))
{
return year+"年是闰年";
}
else
{
return year+"年不是闰年";
}
}
//调用函数
document.write(isLeapYear(2015));
</script>
</head>
<body>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/hyj1/p/5906125.html