<!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>
时间: 2024-10-03 13:38:42