-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbisiesto.html
53 lines (50 loc) · 1.49 KB
/
bisiesto.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculadora de Año Bisiesto</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}
.container {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
input, button {
margin: 10px 0;
padding: 10px;
width: 100%;
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="container">
<h1>Calculadora de Año Bisiesto</h1>
<input type="number" id="yearInput" placeholder="Ingrese el año">
<button onclick="checkLeapYear()">Verificar</button>
<p id="result"></p>
</div>
<script>
function checkLeapYear() {
const year = document.getElementById('yearInput').value;
let result = '';
if ((year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)) {
result = `${year} es un año bisiesto.`;
} else {
result = `${year} no es un año bisiesto.`;
}
document.getElementById('result').innerText = result;
}
</script>
</body>
</html>