Created
January 15, 2016 15:46
-
-
Save jdittrich/9ae2ad6d29699ba7544d to your computer and use it in GitHub Desktop.
replace bro with fam for milan. code from http://stackoverflow.com/questions/1175775/find-all-instances-of-old-in-a-webpage-and-replace-each-with-new-using-a-ja
This file contains hidden or 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
javascript:function htmlreplace(a,b,element){if(!element)element=document.body;var nodes=element.childNodes;for(var n=0;n<nodes.length;n++){if(nodes[n].nodeType==Node.TEXT_NODE){nodes[n].textContent=nodes[n].textContent.replace(new RegExp(a,'gi'),b);}else{htmlreplace(a,b,nodes[n]);}}}htmlreplace('bro','fam'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment