title: Replace function only works once (javascript)
body: <p>I need to replace a string (str1) with another string (str2) every time str1 shows in a specific div. </p>
  
  <p>This is what I got so far</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
  $(window).load(function(){
  
  var str=document.getElementById("foo").innerHTML; 
  var n=str.replace("Google","Yahoo");
  document.getElementById("foo").innerHTML=n;
  
  }); 
  
  &lt;/script&gt;
  </code></pre>
  
  <p>and the html</p>
  
  <pre><code>&lt;div id="foo"&gt;
  Google is the best website ever &lt;br /&gt;
  Google is not the best website ever&lt;/div&gt;
  </code></pre>
  
  <p>Unfortunately, when I run it, it only replaces the first instance of the word Google. </p>
  
  <p>What am I doing wrong? What do I need to add to make it replace ALL the instances of the word? </p>