Skip to content

Instantly share code, notes, and snippets.

@dubs3c
Created January 8, 2020 14:15
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 dubs3c/039759a08b4d926d903047005d072b01 to your computer and use it in GitHub Desktop.
Save dubs3c/039759a08b4d926d903047005d072b01 to your computer and use it in GitHub Desktop.
Convert href links to l33t speak on hover
function Leetspeak() {
var href_array = document.getElementsByTagName("a");
for (let index = 0; index < href_array.length; index++) {
var orginial = "";
href_array[index].onmouseover = function(link){
orginial = link.target.text;
link.target.text = link.target.text
.replace(/s/gi, "5")
.replace(/e/gi, "3")
.replace(/l/gi, "1")
.replace(/i/gi, "1")
.replace(/t/gi, "7")
.replace(/a/gi, "4")
.replace(/o/gi, "0")
.replace(/\+/gi, "-");
}
href_array[index].onmouseout = function(link){
link.target.text = orginial;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment