Answers for "javascript automatically update copyright date"

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(); // returns the year via local timing
  };

  document.getElementById("year").innerHTML = getCurrentYear(); 
  //changing the inner html of the span with "year" id to the given year(2021)
</script>
Posted by: Guest on February-02-2021
0

javascript display copyright date

<p>Copyright &copy; <script>document.write(new Date().getFullYear())</script> Your Name All Rights Reserved</p>
Posted by: Guest on January-23-2022

Code answers related to "javascript automatically update copyright date"

Browse Popular Code Answers by Language