tags:

views:

65

answers:

2

Hi,

I'm just thinking if there is any way how to get information about element in HTML in my .NET application. The input is HTML page and path to CSS files etc. I want to take e.g. H1 tag and found what will be the CSS for it. Is there any code or can I use IE and try to take this information from it automatically inside of my application?

A: 

Using jQuery you can easily retrieve it like this:

var styleToApply = $("#myH1Tag").attr("style");

You can use that for any tag and its associated attributes. You can even add your own if you want.

Mr. Smith
A: 

You could host the IE COM object from within your application, navigate to the page that you want to, and use the currentStyle object from your .NET code (by finding the necessary element in the DOM).

It's a rather complex scenario, but it can be done!

Alexander Gyoshev