Replacing Text Nodes With DOM Nodes
- by Greg
Hey, say I have a text node via XPath. How would I replace the text node with a new DOM node? For example, this little patch of code will go through text nodes, and if text matches something, it will replace it with a corresponding image via img element.
I wanted something faster then a global page regex or even a element innerHTML regex. Any help would be appreciated.
EDIT: Never mind. I figured it out.