title: Javascript Wait until text appear
body: <p>How to wait until some text on a page appear?
  I am using this but it does not work:</p>
  
  <pre><code>function waitText() {
      if (document.getElementsByTagName('p')[0].innerHTML == "Some Text"){
          alert("text appears");
      }else{
          setTimeout(function() { waitText() }, 1000);
  }
  }
  </code></pre>