Posted By

mnstefan on 01/04/11


Tagged

javascript year copyright


Versions (?)

Auto updated copyright year


 / Published in: JavaScript
 

Use case:

  • Paste the javascrit BEFORE the closing body tag </body>
  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  

You need to login to post a comment.