Skip to content

Instantly share code, notes, and snippets.

@malte-j
Created January 3, 2018 22:12
Show Gist options
  • Save malte-j/314e2ebc329ccd7f84364781f2283a54 to your computer and use it in GitHub Desktop.
Save malte-j/314e2ebc329ccd7f84364781f2283a54 to your computer and use it in GitHub Desktop.
appends the current year to all elements with the '.currYear' class
// append the current year to all elements with the '.currYear' class
document.querySelectorAll('.currYear').forEach(node => node.textContent += (new Date()).getFullYear())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment