@HaganeNoKokoroSep 28.2004 — #This seems to work for me in Netscape7 and Firefox 1.0PR, but not IE6 <i> </i><script type="text/javascript"> function getBColor(id) { var stylestuff = document.getElementsByTagName("style")[0].firstChild.data; var start=stylestuff.indexOf(id); var end=stylestuff.indexOf("}", start); var estyle=stylestuff.substring(start, end); var estart=estyle.indexOf("border-color"); var ans=""; if(estart>=0) { ans=estyle.substring(estyle.indexOf(":", estart)+1, estyle.indexOf(";", estart)); } return ans; } </script>
Of course, this only gets you what was defined inside the first style tag in the document (presumably inside the head). If you change the border color somewhere else, then it will still give you the one that was defined in the head.
@artemisauthorSep 28.2004 — #well that certainly works but its not very pretty, ? , and it has many drawbacks. if there isnt a solution then i will have to hard code it in, but i would have liked it to have been dynamic.
@HaganeNoKokoroSep 28.2004 — #Not very pretty? It's ugly as sin! As a side note, it could be made to be dynamic-ish: you could use this in onload to set the element.style.borderColor attribute of elements you want, then just refer to that after. But it's still ugly.