How to automatically update the year in an HTML page using JavaScript

1 Answer

0 votes
<!-- HTML -->
<p>© <span id="year"></span> Website name. All rights reserved.</p
<!-- JAVASCRIPT -->
<script>
  document.getElementById("year").textContent = new Date().getFullYear();
</script>

 



answered Jun 19 by avibootz
...