Home All Groups Group Topic Archive Search About

HtmlElement.GetAttribute

Author
21 Jan 2006 11:18 AM
Ricci Hammond
I am trying to extract css class name attributes from all tags in a html
file:

HtmlDocument myDoc = myWebBrowser.Document;
foreach (HtmlElement myElement in myDoc.All)
{
Debug,WriteLine(myElement.GetAttribute("CLASS"));
}

even when it hits a tag with the class attribute, GetAttribute returns an
empty string. Debugging lets me see that the tag does have the class
attribute with a value (using myElement.outer

Any ideas ?

AddThis Social Bookmark Button