<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<title>Js判断闰年--www.jb200.com</title>
<script type="text/
javascript" languge="javascript">
function isLeapYear(){
var pYear=window.myForm.theYear.value;
if(!isNaN(parseInt(pYear))){
if((pYear%4==0 && pYear%100!=0)||(pYear%100==0 && pYear%400==0)){
window.alert(pYear+"是闰年!");
}else{
window.alert(pYear+"不是闰年!");
}
}else{
window.alert("请输入正确年份!");
}
}
</script>
</head>
<body>
<form action="#" name="myForm" method="post">
<p>请输入年份:<p/>
<input name="theYear" type="text">
<input name="select" type="button" value="点此判断是否是闰年" onClick="isLeapYear()">
</form>
</body>
</html>