Skip to content

Instantly share code, notes, and snippets.

@taliia
taliia / domReplacer.html
Last active September 5, 2015 21:23 — forked from jdeisenberg/domReplacer.html
Crawl through DOM to replace text content
<!DOCTYPE html>
<html xml:lang="en" lang="en"
xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Text Replacer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
//<![CDATA[
function domReplacer(startNode, replaceFunction) {
textReplacer(startNode.firstChild, replaceFunction);