-
-
Save emilsomm/4a987d2dc401553e7d8cc46cd4606acf to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/vevecogohi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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