How to auto fill a text box in C# if it has a name attribute but no ID
<p>If I have an application [c#] with a web browser control in it and I want to fill the first text area with information on a click off a button. How would I do it?</p>

<p>How would I auto fill a textArea in C# with a web browser if it has </p>

<pre><code> &lt;textarea class="profile" name="message"&gt;&lt;/textarea&gt;&lt;br /&gt;
</code></pre>

<p>But no ID field set?</p>

<p>[C#]</p>

<pre><code>private void messageToolStripMenuItem_Click(object sender, EventArgs e)
    {
        webBrowser1.Document
           .GetElementsByTagName("textarea")
           .GetElementsByName("message")[0]
           .SetAttribute("value", "Something");
      //  HtmlDocument doc = this.webBrowser1.Document;
     //   doc.GetElementsByTagName("textarea")[0].SetAttribute("Value", "a");
    }


    private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
    {
        MessageBox.Show("LoadedLux");
        webBrowser1.Document
            .GetElementsByTagName("input")
            .GetElementsByName("q")[0]
            .SetAttribute("value", "Something");
    }
</code></pre>
