Is there a way to access the color of hover links in a function? In other words, what is the DOM path to change it (eg. document.links.hover.color ?????)
hi,
you can change it using getElementById as part of w3c DOM
tested in IE6
will not work in nn4.7 for sure. for the rest who knows :)
<body>
<a href ="http://" id ="somelink" onMouseover ="changeColor(1)"
onMouseout ="changeColor(0)"
>Link to stuff</a>
<br><br>
<form name ="frm">
green<input type = "radio" name = c value ="green"><br>
yellow<input type = "radio" name = c value ="yellow"><br>
orange<input type = "radio" name = c value ="orange"><br>
</form>
</body>
That should provide a read-only version of the color generated during a hover event. (In theory at least in Gecko browsers, though initial testing shows otherwise?)
Until Mozilla implements the OverrideStyle defined in DOM2 CSS, which would look like:
document.getOverrideStyle(refToAnchor, 'hover').setProperty('color', 'newcolor', '');
I believe you'll need to actually navigate through the CSSRule's until:
Keep in mind this is all Mozilla-only. IE has its own proprietary implementation of navigating through CSS rules, but to give it credit, it is remarkably similar to the standards in some ways,