title: Selenium IDE fails getElementById()
body: <p>I have the following statement in my <code>Selenium IDE</code> script:
  I 
      
          store
          javascript{window.document.getElementById('demo').innerHTML}
          text
      </p>
  
  <p>But this always fails with the error</p>
  
  <blockquote>
    <p>[info] Executing: |store | javascript{window.document.getElementById('demo').innerHTML} | text |
    [error] Unexpected Exception: TypeError: window.document.getElementById(...) is null. </p>
  </blockquote>
  
  <p>The HTML source code I am using is from <a href="http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_document_getelementbyid" rel="nofollow">w3schools</a>. The corresponding HTML source is </p>
  
  <pre><code>&lt;p id="demo"&gt;Click the button to change the text in this paragraph.&lt;/p&gt;
  
  &lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;
  
  &lt;script&gt;
  function myFunction() {
      document.getElementById("demo").innerHTML = "Hello World";
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>There is no problem when I execute just</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;store&lt;/td&gt;
      &lt;td&gt;javascript{window.document.innerHTML}&lt;/td&gt;
      &lt;td&gt;text&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>but trying to retrieve an element by its id is not working. What am I missing?</p>