CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    Pakistan
    Posts
    11

    Unhappy 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

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    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.

  3. #3
    Join Date
    Jul 2003
    Location
    Pakistan
    Posts
    11

    Smile 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
  •  





Click Here to Expand Forum to Full Width

Featured