-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathdracula.html
34 lines (31 loc) · 1.04 KB
/
dracula.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Dracula</title>
</head>
<body>
<!-- Once upon a time... -->
<h1>Vampires</h1>
<form>
<label for="location">Location</label>
<input type="text" name="location" value="Transylvania" />
<label for="birthDate">Birth Date:</label>
<input type="number" name="birthDate" value="1428" />
<label for="deathDate">Death Date:</label>
<input type="number" name="deathDate" value="1476" />
<label for="weaknesses">Weaknesses:</label>
<input type="checkbox" name="weaknesses" value="Sunlight" checked />
<input type="checkbox" name="weaknesses" value="Garlic" checked />
<button type="submit">Submit</button>
</form>
<script>
// ...there was a guy named Vlad
const form = document.querySelector("form");
form.addEventListener("submit", (e) => {
const { birthDate, deathDate } = e.target;
const age = deathDate.value - birthDate.value;
});
</script>
</body>
</html>