[Javascript] Q on access CCS values
Walter Torres
walter at torres.ws
Fri Jun 14 12:10:24 CDT 2002
I have this...
#areaOne
{
color: white;
position:absolute;
left:300;
top:100;
width:110;
height:120;
clip:rect(0,300,300,0);
border: 1px solid red;
background-color:red;
layer-background-color:red;
text-align : center;
vertical-align : middle;
font-weight : bold;
z-index : 2;
}
and...
alert ( document.all[strItem].style.pixelWidth );
will display - 110
but...
alert ( document.all[strItem].style.color );
will display - '' [nothing]
My question is, how can I retrieve any and all style attributes via JS?
Also, can I place my own attributes in there and then retrieve these values?
Thanks
Walter
PS: I don't have the option of defining styles inline.
More information about the Javascript
mailing list