jQuery Current Year

Keep your website up to date with the current year with this jQuery Current Year snippet which is particularly useful for showing the current year for Copyright purposes:-

<div>Copyright &copy; <span class="currentyear">Year</span></div>
<script>
jQuery(document).ready( function($) {
currentyear = new Date().getFullYear();
$('.currentyear').text(currentyear);
});
</script>
view raw jQuery Current Year hosted with ❤ by GitHub

Simply ensure that you have added the span (and div container if required) on your page and jQuery will automatically enter the current year. The HTML Copyright symbol has been added for your convenience.

You can see a working example in the footer of this website.

About the Author
jquery current year jQuery Current Year 0da77002febbfe28d15144a57bbcc2c9 s 180 d mm r g

Glenn

A highly experienced Web Designer / Web Developer (Webflow, WordPress, Weebly & Custom), Front-end / Back-end Developer & New Media Specialist, with extensive knowledge of a wide spectrum of technologies in the Development and Creative Industries, built up over a number of years.