Skip to content

Instantly share code, notes, and snippets.

Created December 16, 2017 14:53
Show Gist options
  • Save anonymous/36c9a265556ac21f4b7fdda7ed6ed7bb to your computer and use it in GitHub Desktop.
Save anonymous/36c9a265556ac21f4b7fdda7ed6ed7bb to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/vevecogohi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<span id="year">2017</span>
<script id="jsbin-javascript">
(function(){
var el = document.querySelector("#year");
var date = new Date();
var year = date.getFullYear();
el.innerHTML = year;
}());
</script>
<script id="jsbin-source-javascript" type="text/javascript">(function(){
var el = document.querySelector("#year");
var date = new Date();
var year = date.getFullYear();
el.innerHTML = year;
}());
</script></body>
</html>
(function(){
var el = document.querySelector("#year");
var date = new Date();
var year = date.getFullYear();
el.innerHTML = year;
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment