Posted By

sjmog on 09/24/12


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Ventriloquist Bookmarklet

 / Published in: HTML

Find and Replace anything on (almost) any page.

  1. 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(prompt("What do you want to replace?"),prompt("What do you want to replace it with?"))

Report this snippet  

You need to login to post a comment.