Created
May 23, 2012 15:03
-
-
Save epl692/2775750 to your computer and use it in GitHub Desktop.
Auto Updating Year Copywrite Code
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
<html> | |
<body> | |
<p id="copywrite">©<span id="year">Year-it-is-now</span>. All Rights Reserved.</p> | |
<!-- Add onload="copywrite()" to activate --> | |
<button onclick="copywrite()">Current Year</button> | |
<script type="text/javascript"> | |
function copywrite() | |
{ | |
var date = new Date(); | |
var target = document.getElementById("year"); | |
target.innerHTML=date.getFullYear(); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment