Hi makenzi.exc,
In order to satisfy the Leap Year, following condition need to check.
1. The year is divisible by 4.
2. If the year is divided by 100.
3. The year is divisible by 400.
Refer below example.
HTML
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
body { font-family: Arial; font-size: 10pt; }
</style>
</head>
<body>
<input type="button" value="Submit" onclick="CheckLeapYear()" />
<script type="text/javascript">
function CheckLeapYear() {
var mydate = "2025/01/31"
var year = new Date(mydate).getFullYear();
if (year % 4 == 0) {
alert(year + " is a Leap Year.");
} else {
alert(year + " is a not a Leap Year.");
}
}
</script>
</body>
</html>
Demo