Skip to content

Instantly share code, notes, and snippets.

@thomasballinger
Created June 12, 2012 17:13
Show Gist options
  • Save thomasballinger/2918779 to your computer and use it in GitHub Desktop.
Save thomasballinger/2918779 to your computer and use it in GitHub Desktop.
hacker school name quiz
javascript:(function(){if(document.timesClicked==undefined){document.timesClicked=0;};document.timesClicked++;var names=document.getElementsByClassName('name');for(var i=0;i<names.length;i=i+1){if(!names[i].savedName){names[i].savedName=names[i].innerHTML;}names[i].innerHTML=names[i].savedName;};setTimeout(function(){for(var i=0;i<names.length;i=i+1){names[i].innerHTML='?';};},1000);if(document.timesClicked==1){var ircs=document.getElementsByClassName('irc');for(var i=0;i<ircs.length;i=i+1){ircs[i].savedIRC=ircs[i].innerHTML;ircs[i].innerHTML='?';};var images=document.getElementsByClassName('profile-image');var remove=function(img){var toRemove=img.parentElement.parentElement;var parent=toRemove.parentElement;parent.removeChild(toRemove);};var addRemover=function(img){img.addEventListener('click',function(e){e.preventDefault();remove(img);return false;});};for(var i=0;i<images.length;i=i+1){addRemover(images[i])};};})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment