<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<input type="text" id="x">
<input type="button" value="判断" "testf()">
<input type="text" id="y">
</body>
</html>
<script type="text/javascript">
function testf(){
var x=parseInt(document.getElementById("x").value)
if((x%4==0 && x%100!=0) || (x%400==0)){
y="闰年"
}else{
y="平年"
}
document.getElementById("y").value=y;
}
</script>
判断是平年还是闰年
最新推荐文章于 2023-03-19 20:42:40 发布