# findAndReplaceDOMText **Repository Path**: mirrors_sivan/findAndReplaceDOMText ## Basic Information - **Project Name**: findAndReplaceDOMText - **Description**: :mag: Find and replace DOM text - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-07-17 - **Last Updated**: 2025-12-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # findAndReplaceDOMText Forked from [padolsey/findAndReplaceDOMText](https://github.com/padolsey/findAndReplaceDOMText), add offset option to fix browsers which don't support regex lookbehind. **[See the demo](http://padolsey.github.com/findAndReplaceDOMText/demo.html)** `findAndReplaceDOMText` searches for regular expression matches in a given DOM node and replaces or wraps each match with a node or piece of text that you can specify. For example: ```html

123 456 Hello

``` ```js findAndReplaceDOMText(document.getElementById('t'), { find: /Hello/, wrap: 'em' }); ``` This would result in: ```html

123 456 Hello

``` And it also works when matches are spread **across multiple nodes**! E.g. ```html

123 456 Hello Goodbye

``` ```js findAndReplaceDOMText(document.getElementById('t'), { find: /Hello/, wrap: 'em' }); ``` This would result in: ```html

123 456 Hello Goodbye

``` The `EM` element has been added twice, to cover both portions of the match. ## Installation Grab the latest [findAndReplaceDOMText.js](https://github.com/padolsey/findAndReplaceDOMText/blob/master/src/findAndReplaceDOMText.js) (or `npm install findandreplacedomtext`) and include it as a `