mirror of
https://github.com/hexahigh/080609.git
synced 2025-12-11 19:55:06 +01:00
e
This commit is contained in:
parent
dca9e1e90c
commit
b9ffab746f
@ -10,6 +10,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<p>If you were born on the 8th of June 2009 you would be</p>
|
||||
<h3 id="age"><p>Years old</p></h3>
|
||||
<h3 id="age"></h3>
|
||||
</body>
|
||||
</html>
|
||||
4
index.js
4
index.js
@ -4,5 +4,5 @@ function calculateYearsSince(date) {
|
||||
return Math.floor(diffInYears);
|
||||
}
|
||||
|
||||
const myDate = new Date('2009-01-01');
|
||||
document.getElementById("age").innerText = calculateYearsSince(myDate);
|
||||
const myDate = new Date('2009-08-06');
|
||||
document.getElementById("age").innerText = calculateYearsSince(myDate); + "<p>Years old</p>"
|
||||
Loading…
x
Reference in New Issue
Block a user