Auto Update The Copyright Year In Your Website – updateYourYearPLZ

Category: Javascript | January 18, 2019
Author:jusleg
Views Total:436 views
Official Page:Go to website
Last Update:January 18, 2019
License:MIT

Preview:

Auto Update The Copyright Year In Your Website – updateYourYearPLZ

Description:

The simplest way to automatically update the copyright year in your website’s footer section using the Date.prototype.getFullYear() API.

How to use it:

Wrap the copyright year in an element.

<span id="updateYourYearPLZ"></span>

The main JavaScript to auto update the copyright year.

document.addEventListener('DOMContentLoaded', function () {
  document.getElementById("updateYourYearPLZ").innerHTML = new Date().getFullYear();
});

 

You Might Be Interested In:


Leave a Reply