Welcome to WebmasterWorld Guest from

Forum Moderators: travelin cat

Message Too Old, No Replies

document.getElementById.style.backgroundColor on IE5 for MAC



6:48 am on Oct 5, 2004 (gmt 0)

Hi all,

the following javascript does not works with "IE5 for MAC".

If you want to try the program, here is the link:


On "IE5 for MAC" after selecting a checkbox and pressing the button "INIZIA" the table disappears.

Probably the problem is in the following line:

document.getElementById(id).style.backgroundColor = '#c0c0c0';

If you look in the code you will find this line in the function initGame().

On all other browser works OK!

Note: this is for a free program that I am writing for a primary school. I do not work on MAC and therefore it is for me very hard to find the problem.
Any help is appreciated.



[edited by: Macguru at 1:31 pm (utc) on Oct. 6, 2004]
[edit reason] Per TOS, no links to own please. [/edit]


1:59 pm on Oct 5, 2004 (gmt 0)

Your code looks ok to me. I use something like the following which AFAIK works in all common browsers:

var el = document.getElementById(id);
if(el.currentStyle) {
// for msie
el.style.backgroundColor = "#c0c0c0";
} else {
// for real browsers ;)
el.style.setProperty("background-color", "#c0c0c0");

Featured Threads

Hot Threads This Week

Hot Threads This Month