Skip to content

Instantly share code, notes, and snippets.

@hlorand
Last active August 29, 2015 14:20
Show Gist options
  • Save hlorand/e1044d39ba920fb7d862 to your computer and use it in GitHub Desktop.
Save hlorand/e1044d39ba920fb7d862 to your computer and use it in GitHub Desktop.
A sclipt lecseléli az összes "r" betűt "l" betűle.
/*
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