N
Nathan Sokalski
I am trying to access/modify CSS properties in my JavaScript. I have been
able to do this fine with some properties, such as with the following
eventhandler:
onClick="window.alert(test.style.height);"
This would show an alert with the value used in the CSS for the height,
possibly something like "29px" However, if I try to access a CSS property
that contains a - such as the following:
onClick="window.alert(test.style.background-color);"
I recieve an error saying the following:
Error: 'color' is undefined
I am wondering if there is any kind of workaround for this, because there
are an awful lot of CSS properties that contain -'s, and it seems kind of
pointless to allow the codewriters to only access some of them. Any ideas?
Thanks.
able to do this fine with some properties, such as with the following
eventhandler:
onClick="window.alert(test.style.height);"
This would show an alert with the value used in the CSS for the height,
possibly something like "29px" However, if I try to access a CSS property
that contains a - such as the following:
onClick="window.alert(test.style.background-color);"
I recieve an error saying the following:
Error: 'color' is undefined
I am wondering if there is any kind of workaround for this, because there
are an awful lot of CSS properties that contain -'s, and it seems kind of
pointless to allow the codewriters to only access some of them. Any ideas?
Thanks.