Remove or replace multiple words using Vanilla JavaScript

Sometimes we need to remove multiple words from a page.

The easiest way is using a replace method.

First we need to select all the text that needs to be replaced.

The easiest way is using querySelectorAll.

For querySelectorAll we need a for loop and here forEach methods come handy.

forEach method will loop on all of the elements of querySelectorAll and then we can perform operations on it.

Now we just need to use string replace method inside a forEach loop.

Below is a code for it.