<html>
<head>
<script language="javascript">
function check(){
var year1=form1.year.value;
if((year1%4)==0&&(year1%100)!=0){
window.alert(year1+"年是闰年!");
}
}
</script>
</head>
<body>
<form action="" method="post" name="form1">
<span class="style2">检测闰年:</span>
<select name="year">
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
</select>
<input type="submit" name="submit" value="检测" onClick="check();">
</form>
</body>
</html>
JSP 检测闰年实例
最新推荐文章于 2023-12-11 15:03:03 发布