Created
January 3, 2018 22:12
-
-
Save malte-j/314e2ebc329ccd7f84364781f2283a54 to your computer and use it in GitHub Desktop.
appends the current year to all elements with the '.currYear' class
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
// 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