This commit is contained in:
parent
6bde3c4ff8
commit
ce25a49e61
2 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
[{
|
[{
|
||||||
"q": "How old are you?",
|
"q": "How old are you?",
|
||||||
"a": "I'm XXX years old. This automatically updates now, too, so I won't ever forget to update it again!"
|
"a": "I'm <span id=\"age\"></span> years old. This automatically updates now, too, so I won't ever forget to update it again!"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"q": "Where are you from?",
|
"q": "Where are you from?",
|
||||||
|
|
|
@ -12,4 +12,10 @@
|
||||||
</p>
|
</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
|
let birthdayMillis = Date.UTC(1999, 5 - 1, 21);
|
||||||
|
let todayMillis = Date.now();
|
||||||
|
let ageSinceStart = new Date(todayMillis - birthdayMillis);
|
||||||
|
$("#age").html(ageSinceStart.getUTCFullYear() - 1970);
|
||||||
|
</script>
|
||||||
</div>
|
</div>
|
Loading…
Reference in a new issue