Created
June 18, 2020 13:40
-
-
Save hsnyc/1ff2dd497fc77b17198815b69f797ab7 to your computer and use it in GitHub Desktop.
Add current year to a div in footer
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
<footer> | |
<div class="wrapper">©<span id="current-year">2019</span> HSNYC</div> | |
</footer> |
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
// 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