Skip to content

Instantly share code, notes, and snippets.

@emilsomm
Forked from anonymous/index.html
Created December 16, 2017 14:55
Show Gist options
  • Save emilsomm/4a987d2dc401553e7d8cc46cd4606acf to your computer and use it in GitHub Desktop.
Save emilsomm/4a987d2dc401553e7d8cc46cd4606acf 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