<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>判断闰年</title>
</head>
<body><form action="" method="get" name="form1" id="form1">
请输入年份:
<label>
<input name="nian" type="text" id="nian" size="4" maxlength="4" />
</label>
<label>
<input type="button" name="Submit" value="是否闰年" onclick="aaa()" />
</label>
</form>
<script type="text/javascript">
//闰年:能被4整除不能被100整除;能被100整除也能被400整除.
function aaa(){
var a=document.form1.nian.value;
if(((a%4==0)&&(a%100!=0))||((a%100==0)&&(a%400==0)))
{
alert(a+"年是闰年");
}
else
{
alert(a+"年不是闰年")
}
}
</script>
</body>
</html>
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>判断闰年</title>
</head>
<body><form action="" method="get" name="form1" id="form1">
请输入年份:
<label>
<input name="nian" type="text" id="nian" size="4" maxlength="4" />
</label>
<label>
<input type="button" name="Submit" value="是否闰年" onclick="aaa()" />
</label>
</form>
<script type="text/javascript">
//闰年:能被4整除不能被100整除;能被100整除也能被400整除.
function aaa(){
var a=document.form1.nian.value;
if(((a%4==0)&&(a%100!=0))||((a%100==0)&&(a%400==0)))
{
alert(a+"年是闰年");
}
else
{
alert(a+"年不是闰年")
}
}
</script>
</body>
</html>