Skip to content

Instantly share code, notes, and snippets.

@amanda
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amanda/5cb0b7f6f5c9d738ddf8 to your computer and use it in GitHub Desktop.
Save amanda/5cb0b7f6f5c9d738ddf8 to your computer and use it in GitHub Desktop.
Adds the "marquee" tag to either a div with the ID "content" (first version) or the first div in the DOM (second) to make the internet fun again. Use http://mrcoles.com/bookmarklet/ to convert code to a nice link!
//bookmarklets
javascript:(function()%7B(function()%7Bvar%20h%3Ddocument.getElementById(%22content%22).innerHTML%3Bvar%20n%3D%22%3Cmarquee%3E%22%2Bh%2B%22%3C%2Fmarquee%3E%22%3Bdocument.getElementById(%22content%22).innerHTML%3Dn%3B%7D)()%7D)()
javascript:(function()%7B(function()%7Bvar%20h%3Ddocument.getElementsByTagName(%22div%22)%5B0%5D.innerHTML%3Bvar%20n%3D%22%3Cmarquee%3E%22%2Bh%2B%22%3C%2Fmarquee%3E%22%3Bdocument.getElementsByTagName(%22div%22)%5B0%5D.innerHTML%3Dn%3B%7D)()%7D)()
//pretty versions
//grabs div id="content" and marquees it
(function(){
var h=document.getElementById("content").innerHTML;
var n="<marquee>"+h+"</marquee>";
document.getElementById("content").innerHTML=n;
})();
//first whole div version
(function(){
var h=document.getElementsByTagName("div")[0].innerHTML;
var n="<marquee>"+h+"</marquee>";
document.getElementsByTagName("div")[0].innerHTML=n;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment