Last active
January 2, 2016 00:39
-
-
Save TravelingTechGuy/8224859 to your computer and use it in GitHub Desktop.
Add the current year to copyright notice/footer
This file contains hidden or 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
<!-- Assuming you have the text © <span id="year"></span> in your footer --> | |
<!-- Without jQuery, add to bottom of page --> | |
<script>document.getElementById('year').textContent = (new Date()).getFullYear();</script> | |
<!-- If you're using jQuery, add this to $(document).ready() or $(function()) --> | |
$('#year').text((new Date()).getFullYear()); | |
<!-- One line in the HTML page --> | |
<footer>copyright © <script>document.write((new Date()).getFullYear());</script></footer> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment