Question: Is there a way to replace the normal text within a table element that is placed within the body of the HTML?

Like replacing "hello" with "hi"?

Please only use **JavaScript** without **jQuery**.

Answer: 
Sometimes changing `document.body.innerHTML` breaks some JS scripts on page. Here is version, that only changes content of `text` elements:

```js
function replaceRecursively(element, from, to) {
    if (element.childNodes.length) {
        element.childNodes.forEach(child => replaceRecursively(child, from, to));
    } else {
        const cont = element.textContent;
        if (cont) element.textContent = cont.replace(from, to);
    }
};

replaceRecursively(document.body, new RegExp("hello", "g"), "hi");

```
Wanted to add an example to [funky-future's answer](https://stackoverflow.com/a/50537862/9069373) as I kept getting this error:

```
Uncaught TypeError: element.childNodes is not iterable

```

use like this:

```
replaceInText(document.body,"search term","replacement");

```

it didn't work for me with jQuery selectors.