there must be a way to get the style of an element.
i want to be able to click some text, and it tell me the size, the color, the family.
i found this function
[CODE]//gets a style
function getStyle(oElm, strCssRule){
var strValue = “”;
if(document.defaultView && document.defaultView.getComputedStyle){
strValue = document.defaultView.getComputedStyle(oElm, “”).getPropertyValue(strCssRule);
}
else if(oElm.currentStyle){
strCssRule = strCssRule.replace(/-(w)/g, function (strMatch, p1){
return p1.toUpperCase();
});
strValue = oElm.currentStyle[strCssRule];
}
return strValue;
}
but that only gets an inline style.
if i have <span id=”red”>text</span> i should somehow be able to tell that its red, even if its defined in the head or a in another file, the browser must do something to display as red, how can get the color?
anyone have a clue?