1

In my website, there have many page and content. Now I want to replace one word from all page when website is loaded.

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Shapon Pal
  • 1,098
  • 3
  • 16
  • 27
  • 2
    Refer to [this](http://stackoverflow.com/questions/5558613/javascript-replace-text-in-the-html-body) – Aakash Aug 17 '16 at 11:16

1 Answers1

0

timer = setInterval(myFunction,100);
function myFunction() {
    var str = document.getElementById("demo").innerHTML; 
    var res = str.replace("hello", "hi");
    document.getElementById("demo").innerHTML = res;
}
<p>Click the button to replace "hello" with "hello" in the paragraph below:</p>

<p id="demo">Visit hello!</p>