Adding Current Year Dynamically in Copyright section in footer of Homepage.

For updating the year in the copyright section in footer of home page as shown below:

Use this code:

<p>Copyright © <span id="currentYear"></span>, All Right Reserved</p>

<script> var date = new Date();
                var year = date.getFullYear();
                document.getElementById('currentYear').innerHTML = year; </script>

The year in the copyright section will be updated automatically according to the current date.

Leave a comment

Your email address will not be published. Required fields are marked *