|
-
January 29th, 2008, 05:33 AM
#1
style.color does not work in firefox
Hi all,
The following code runs fine on internet explorer but not in firefox.
I figured out that elm[i].style.color is not working, there's no error
displayed either. Will anybody help me find the correct code for firefox?
Thanks a lot.
Code:
var elm = document.getElementsByTagName("a");
//alert(elm.length);
for(var i=0;i<elm.length;i++)
{
if(elm[i].style.color=="saddlebrown")
alert(elm[i].style.color);
}
Last edited by PeejAvery; January 29th, 2008 at 07:46 AM.
baburman
-
January 29th, 2008, 07:49 AM
#2
Re: style.color does not work in firefox
The reason is because saddlebrown is only going to be recognized by IE. You need to use hexidecimal colors instead of color names.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
January 30th, 2008, 12:01 AM
#3
Re: style.color does not work in firefox
Thankyou very much, i'll do this when i go to office.
Babur
baburman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|