homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / The Macintosh Webmaster
Forum Library, Charter, Moderators: travelin cat

The Macintosh Webmaster Forum

document.getElementById.style.backgroundColor on IE5 for MAC

10+ Year Member

Msg#: 600 posted 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]



10+ Year Member

Msg#: 600 posted 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");

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / The Macintosh Webmaster
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved