Skip to content

Instantly share code, notes, and snippets.

@jdittrich
Created January 15, 2016 15:46
Show Gist options
  • Save jdittrich/9ae2ad6d29699ba7544d to your computer and use it in GitHub Desktop.
Save jdittrich/9ae2ad6d29699ba7544d to your computer and use it in GitHub Desktop.
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