Search code examples
c#winformsmshtml

How to access the uniqueID property from an HtmlElement?


How can I access the uniqueID property from an HtmlElement?

I know how to cast from HtmlElement to MSHTML's interfaces, but I don't know which interface to use.


Solution

  • I figured it out:

    mshtml.IHTMLUniqueName id = element.DomElement as mshtml.IHTMLUniqueName;
    MessageBox.Show(id.uniqueID);