title: How to get the innerText from currently selected option in a webBrowser control
body: <p>I need to select the <code>innerText</code> from the currently selected option in the webBrowser control.</p>
  
  <p>Here is a representation of the html:</p>
  
  <pre><code>&lt;SELECT ID="F8"&gt;
  &lt;OPTION VALUE="option1"&gt;option1&lt;/OPTION&gt;
  &lt;OPTION VALUE="option2" selected&gt;option2&lt;/OPTION&gt;
  &lt;OPTION VALUE="option3"&gt;option3&lt;/OPTION&gt;
  &lt;/SELECT&gt;
  </code></pre>
  
  <p>Here is what I am trying:</p>
  
  <pre><code>if (webBrowser1.Document.GetElementById("F8") != null)
  {
      HtmlElement selectF8 = webBrowser1.Document.GetElementById("F8");
      foreach (HtmlElement item in selectF8.Children ) 
      {
          if (item.GetAttribute("selected") != null)
          {
              assigneeText.Text = item.InnerText;
          }
      }
  }
  </code></pre>
  
  <p>... but it completely ignores the if statement and always assigns <code>assigneeText.Text</code> the value of <code>option3</code> instead of the value of the selected <code>option2</code>.</p>
  
  <p>Can someone please tell me what I am doing wrong?</p>