tags:

views:

38

answers:

1

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.

A: 

How do you do it? Please post the solution. I need it too.

Dipesh