Return to Snippet

Revision: 38489
at January 4, 2011 04:16 by mnstefan


Updated Code
Copyright &copy; 1999 - <span id="current-year"></span>

<script type="text/javascript">
 function getCurrentYear(){
  var d = new Date();
  return d.getFullYear();
 }
 el = document.getElementById('current-year');
 el.innerHTML = getCurrentYear();
</script>

Revision: 38488
at January 4, 2011 04:15 by mnstefan


Updated Code
Copyright &copy; 1999 - <span id="current-year"></span>

<script type="text/javascript">
function getCurrentYear(){
var d = new Date();
return d.getFullYear();
}
el = document.getElementById('current-year');
el.innerHTML = getCurrentYear();

</script>

Revision: 38487
at January 4, 2011 04:10 by mnstefan


Initial Code
<script type="text/javascript">

function getCurrentYear(){
var d = new Date();
return d.getFullYear();
}
el = document.getElementById('current-year');
el.innerHTML = getCurrentYear();

</script>

Initial URL

                                

Initial Description
Use case:

* Paste the javascrit BEFORE the closing body tag `</body>`

Initial Title
Auto updated copyright year

Initial Tags
javascript

Initial Language
JavaScript