Skip to content

Conversation

@maeriens
Copy link

@maeriens maeriens commented Jan 7, 2019

This is to show the current year, addressing issue #68

I have literally no idea how I managed it, I simply copied more or less how the data was being replaced in the 2nd slide. I guess that's what people call programming.

@nerdius
Copy link

nerdius commented Sep 14, 2019

A better approach would be using a <span> with an unique ID, then selecting that from JavaScript and assigning a value to its innerHTML. There's also no need to have a function at all.

Here's the code:

HTML:

Meanwhile: it's <span id="current-year"></span>, the West has been at peace for decades, and

JavaScript:

document.querySelector('#current-year').innerHTML = new Date().getFullYear();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants