brgivens
asked on
BODY color?
Hi,
I'm trying to create an object with the same background color as the document.body. I thought this would be a no brainer, but apparently not:
<html>
<style>
body{background:#05ae55}
</style>
<head>
<script language="javascript">
function test(){alert(document.body .style.bac kgroundCol or);}
</script>
</head>
<body onload="test();">
</body>
</html>
What am I missing? Surely, there's a setting which stores the actual color of the body? I need to be able to figure out the color of the body, regardless of how it's been set.
I'm trying to create an object with the same background color as the document.body. I thought this would be a no brainer, but apparently not:
<html>
<style>
body{background:#05ae55}
</style>
<head>
<script language="javascript">
function test(){alert(document.body
</script>
</head>
<body onload="test();">
</body>
</html>
What am I missing? Surely, there's a setting which stores the actual color of the body? I need to be able to figure out the color of the body, regardless of how it's been set.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry GwynforWeb didnt see your post. ( now where have i seen this message recently ;-) )
ASKER
Thanks... I knew it had to be something easy :)
HTH