Created
October 8, 2020 11:57
-
-
Save grace-snow/99e81aa630226ac23135a585d4ac5bf6 to your computer and use it in GitHub Desktop.
A little function to insert the current year into something like a copyright notice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Insert year into footer | |
function outputCurrentYear() { | |
const today = new Date(); | |
const currentYear = today.getFullYear(); | |
const el = document.querySelector('#copyright-year'); | |
el.innerHTML = currentYear; | |
} | |
outputCurrentYear(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment