Skip to content

Instantly share code, notes, and snippets.

@hsnyc
Created June 18, 2020 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsnyc/1ff2dd497fc77b17198815b69f797ab7 to your computer and use it in GitHub Desktop.
Save hsnyc/1ff2dd497fc77b17198815b69f797ab7 to your computer and use it in GitHub Desktop.
Add current year to a div in footer
<footer>
<div class="wrapper">&copy;<span id="current-year">2019</span> HSNYC</div>
</footer>
// Place Current Year in Page Footer =================================//
let date = new Date();
let currentYear = date.getFullYear();
let yearSpan = document.getElementById('current-year');
yearSpan.innerHTML = currentYear;
// End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment