title: document.getelementbyid not working inside loop/if
body: <p>My problem is simple yet i cannot figure out why it's not working inside of if/loop. Here are some examples:</p>
  
  <p>Working one:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      webBrowser1.Document.GetElementById("login").SetAttribute("value", "something");
      webBrowser1.Document.GetElementById("password").SetAttribute("value", "something");
  }
  </code></pre>
  
  <p>Non working one:</p>
  
  <pre><code>if (webBrowser1.IsBusy == false)
  {
      webBrowser1.Document.GetElementById("login").SetAttribute("value", "something");
      webBrowser1.Document.GetElementById("password").SetAttribute("value", "something");
  }
  </code></pre>
  
  <p>No matter what the "if" statement is, it's not working. Also tried with "for", also tried to get it out of the loop of "for", i still get this error: "Object reference not set to an instance of an object."</p>