Last active
March 1, 2017 02:05
-
-
Save shanechin1/4486535 to your computer and use it in GitHub Desktop.
My first attempt at a bookmarklet. A simple one which inserts the current date on a page.
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
javascript: (function(){ | |
alert("Hello?!"); | |
var today = new Date(); | |
var day = today.getDate(); | |
var month = today.getMonth() + 1; | |
/* January starts with zero */ | |
var year = today.getFullYear(); | |
var thisDate = month + '/' + day + '/' + year; | |
alert(thisDate); | |
document.write(thisDate); | |
}()); | |
/* I previously used the other comment style, which broke the bookmarklet */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment