Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function htmlreplace(a,b,element){
- var nodes = (!element) ? document.body.childNodes : 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('[^ ]','g');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement