title: How to get the node name of the parent node of an html element using c#
body: <p>Well i need to get the parent node name and its respective attributes of an html element using c#.</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>&lt;dl class="dlbox"&gt;
    &lt;dd&gt; 
        &lt;a class="btn primary" href="http://testurl.org"&gt;
              &lt;span&gt;Lorem Ipsum&lt;/span&gt;
              &lt;span class="icnsm"&gt;&lt;/span&gt;     
        &lt;/a&gt;
    &lt;/dd&gt;
  &lt;/dl&gt;
  </code></pre>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>System.Windows.Forms.HtmlDocument doc = webBrowser1.Document; 
          HtmlElementCollection col = doc.GetElementsByTagName("a");
  
                  int i = 0;
  
                  foreach (HtmlElement element in col)
                  {
              textBox8.Text = textBox8.Text + col[i].GetAttribute("id") + "\r\n";
                  i = i + 1;         
          }
  </code></pre>
  
  <p><strong>Note:</strong> I am looping through the page and searching for all anchor tags, but i need to check the parent element at 2nd level i.e.  exists or not for  the respective anchor tag, if it exists then i need to get the class name for the respective dl using c#.</p>
  
  <p>Thanks! Any help shall be greatly appreciated!</p>