Changing the link color programmatically

advertisements

I am currently changing styling from code behind by doing:

Div.Style["StyleAttribute"] = MyValue;

I want to change essentially only the a link tags color within the Div programatically is this possible?

The solution must not make use of HTML5.

The content is always dynamic, the links aren't static so using runat="server" is not possible.

Next step would be to see if I can change the active, hover and visited states.


Jquery version:

$('a', $('#divId')).css('color', 'red')

JQuery docs: