Last active
August 29, 2015 14:20
-
-
Save hlorand/e1044d39ba920fb7d862 to your computer and use it in GitHub Desktop.
A sclipt lecseléli az összes "r" betűt "l" betűle.
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
/* | |
Lépa letek mogyoló, kolán leggel litkán likkant a ligó. | |
A sclipt lecseléli az összes "r" betűt "l" betűle. | |
*/ | |
function ponciusz() { | |
var elements = document.querySelectorAll("body, body *"); | |
var results = []; | |
var child; | |
for(var i = 0; i < elements.length; i++) { | |
child = elements[i].childNodes[0]; | |
if(elements[i].hasChildNodes() && child.nodeType == 3) { | |
results.push(child); | |
} | |
} | |
return results; | |
} | |
var textnodes = ponciusz(), | |
_nv; | |
for (var i = 0, len = textnodes.length; i<len; i++){ | |
_nv = textnodes[i].nodeValue; | |
textnodes[i].nodeValue = _nv.replace(/r/g,'l'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment