auto update copyright year javascript

Solutions on MaxInterview for auto update copyright year javascript by the best coders in the world

showing results for - "auto update copyright year javascript"
Marta
28 Sep 2019
1<div class="copyright">
2  <footer>Copyright © <span id="year"></span> , All rights reserved to X</footer>
3</div>
4<script>
5  
6  function getCurrentYear() {
7    return new Date().getFullYear(); // returns the year via local timing
8  };
9
10  document.getElementById("year").innerHTML = getCurrentYear(); 
11  //changing the inner html of the span with "year" id to the given year(2021)
12</script>