Skip to content

Instantly share code, notes, and snippets.

@theshahzaib5
Created September 1, 2014 07:54
Show Gist options
  • Save theshahzaib5/b89338444d2ad1fb319a to your computer and use it in GitHub Desktop.
Save theshahzaib5/b89338444d2ad1fb319a to your computer and use it in GitHub Desktop.
jquery get current year
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Jquery</title>
<style type="text/css">
</style>
<script type="text/javascript" src="jquery-1.11.1.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
footerUpdateDate();
});
function footerUpdateDate(){
var d = new Date();
$("span.year").text(d.getFullYear())
}
</script>
</head>
<body>
<span class="year">2011</span>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment