title: Testing innerHTML for partial string
body: <p>Alright, I'm attempting to cycle through html elements within an iFrame to capture certain fields within a report.  The structure of the HTML is as follows</p>
  
  <pre><code>html&gt;frameset&gt;frame&gt;html&gt;body&gt;table&gt;tbody&gt;tr&gt;td.set2&gt;pre&gt;(Text)
  </code></pre>
  
  <p>The JS I'm using to capture the .innerHTML is below</p>
  
  <pre><code>document.parentWindow.frames("Frame"B).document.all.tags("pre")[x].innerHTML
  </code></pre>
  
  <p>Now the above line will allow me to capture the innerHTML of the 'pre' element that contains the report name and the information I'm looking for.  I'm currently working in the IE console to get my JS right before I move it to AutoHotKey but below is the function I'm attempting to use to cycle through all 'pre' elements</p>
  
  <pre><code>function preTest(){
  for(x=0; x &lt; pre.length; x++){
      if(pre[x].innerHTML = "CLMPRUN"){
        return pre[x].innerHTML;
      } else {
      return false;
      }
    }
  };
  </code></pre>
  
  <p>Now, the problem is that when I run the function, it only returns "CLMPRUN".  Whenever I change the test in the if statement, it returns as if I've declared pre[x].innerHTML as a variable.</p>
  
  <p>Any thoughts?</p>