title: Visual Basic: Set attribute of web element whitout ID
body: <p>HTML:</p>
  
  <pre><code>&lt;input type="text" size="15" maxlength="79" value="" name="username"&gt;
  </code></pre>
  
  <p>As you can see, no ID. The HTML above is a textbox that i want to auto fill in whit my value as soon as i start the webpage whit my code.</p>
  
  <p>this is what i found:</p>
  
  <pre><code>WebBrowser1.Document.Forms(0).GetElementsByTagName("username")(0).SetAttribute("value", (Text))
  </code></pre>
  
  <p>But whit this i get the error:</p>
  
  <pre><code>Value of '0' is not valid for 'index'. 'index' should be between 0 and -1.
  Parameter name: index
  </code></pre>
  
  <p>What am i doing wrong?</p>