Cheers, scripts.contact! That works great, even though I don't quite know,
let alone understand that method. I guess being stuck with JS1.3 and old
browsers is the reason, have to fast-forward to version 1.5 and Gecko-based
DOM (as I understand both FF and Opera try adhering to it).
"scripts.contact" <sc*************@gmail.comwrote in message
news:11**********************@g37g2000prf.googlegr oups.com...
Just One wrote:
Hi,
I'm trying to dynamically assign a div background the value of the
document
background with a code like this:
var menuDiv = '<div style="visibility:hidden; ';
menuDiv = menuDiv + 'background-color:';
menuDiv = menuDiv + document.bgColor;
menuDiv = menuDiv + '></div>';
Randy's suggestion will not work, try this:
var menuDiv = '<div style="visibility:hidden; ';
menuDiv = menuDiv + 'background-color:';
menuDiv = menuDiv +
(document.bgColor||
getComputedStyle(document.body,null).backgroundCol or||'transparent');
menuDiv = menuDiv + '></div>';