Thanks for the tip Kevin,

I cracked it in the end by referring to the full name of the property:

var borderColor = $(this).css("border-left-color");

As borders are usaully the same color all around the element this will
suffice and it works in both IE and FF

Cheers

On Nov 16, 6:45 pm, Kevin Scholl <[EMAIL PROTECTED]> wrote:
> "borderColor" is a reserved word, so it shouldn't be used as a
> variable name. Try using something else, maybe "bColor" or something
> like that. Also, you might want to replace css("border-color") with
> css("borderColor") for consistency.
>
> $("#mydiv").each(function() {
>   var bColor = $(this).css("borderColor");
>   alert(bColor);
>
> HTH
>
> On Nov 16, 9:32 am, wellmoon <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I want to get the border-color of a div.  The following code works in
> > IE and alerts the color of the border:
>
> > $("#mydiv").each(function() {
> >   var borderColor = $(this).css("border-color");
> >   alert(borderColor);
>
> > });
>
> > In FireFox it just alerts 'undefined'
>
> > The border is set with CSS, not by javascript or jquery.  Am I doing
> > something worng or is this a bug?- Hide quoted text -
>
> - Show quoted text -

Reply via email to