Auto Update Copyright Year in a Website code example
Example 1: get year javascript copyright
<script type="text/JavaScript"> var theDate=new Date() document.write(theDate.getFullYear()) </script>
Example 2: auto update copyright year javascript
<div class="copyright">
<footer>Copyright © <span id="year"></span> , All rights reserved to X</footer>
</div>
<script>
function getCurrentYear() {
return new Date().getFullYear();
};
document.getElementById("year").innerHTML = getCurrentYear();
</script>