Auto updated copyright year


/ Published in: JavaScript
Save to your folder(s)

Use case:

* Paste the javascrit BEFORE the closing body tag ``


Copy this code and paste it in your HTML
  1. Copyright &copy; 1999 - <span id="current-year"></span>
  2.  
  3. <script type="text/javascript">
  4. function getCurrentYear(){
  5. var d = new Date();
  6. return d.getFullYear();
  7. }
  8. el = document.getElementById('current-year');
  9. el.innerHTML = getCurrentYear();
  10. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.