Created
January 8, 2020 14:15
-
-
Save dubs3c/039759a08b4d926d903047005d072b01 to your computer and use it in GitHub Desktop.
Convert href links to l33t speak on hover
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 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