-
Notifications
You must be signed in to change notification settings - Fork 0
/
age.html
46 lines (44 loc) · 1.74 KB
/
age.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Age Calculator</title>
<link rel="stylesheet" href="ageStyle.css">
</head>
<body>
<div class="container">
<h1>Age Calculator</h1>
<div class="input-group">
<label for="birth-year">Year</label>
<input type="number" id="birth-year" min="1900" max="2024">
</div>
<div class="input-group">
<label for="birth-month">Month</label>
<select id="birth-month" onchange="validateDate()">
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
</div>
<div class="input-group">
<label for="birth-day">Day:</label>
<input type="number" id="birth-day" min="1" max="31" oninput="validateDate()">
</div>
<p id="birthday-display"></p>
<button class="button-29" role="button" onclick="calculateAge()">Calculate Age</button>
<button class="button-28" role="button" onclick="clearFields()">Clear</button>
<p id="result"></p>
</div>
<script src="ageJS.js"></script>
</body>
</html>