How to update the footer year HTML Dynamically?

Published 3 Jan, 2022

Reading time: 1 Mins

Use a simple javascript line to update the footer html easily every year.


When comes to static blog page or any website that no longer needs updates needs one particular update in every year which is updating the footer year. This update needs some one have to commit to the file and push it to the frontend but this is lot of works right? How we can simply this so that we don’t have to update every year ah?


Well, I’m sharing how to do those things here in this page which is very easy and you can copy paste in your html which will work like magic 🪄

const thisYear = new Date().getFullYear()


Here we go now that you know the code about how to get the current year you can add this in your html and you will happily ever after.

This article published under development on javascript tags. If you wish to receive email from me when I post a new blog post then please subscribe to my newsletter.

You might also like