i know all this Guiliano, and according to what i've googled about javascript style.border, it can retrieve the value if that value has been set before, which is the case here.
in any case, if in the css, you 've set #id{ border: 1px solid #FF0000;} then it would only make sense that $('#id').css('border-color'); return #FF0000 yet it does not. If it is not a bug, it's definitely a place for improvement. On Thu, Apr 24, 2008 at 5:41 PM, Giuliano Marcangelo < [EMAIL PROTECTED]> wrote: > Alexandre, > > to access the border properties, you have to be more specific.......... > > border has four sides, top - right- bottom - left > . > and also style, color and width properties.... > > so to get your required css....you need to access (as an example) > > border-bottom-style ..... or > border-bottom-color ..... or > border-bottom-width > > jQuery is good , but does not possess a crystal ball....... > > if you think about the border ( and also padding / margin) properties, each > border can be a different color/width and style to each of its neighbours, > so you have to be explicit in your request > > hope this helps :-) > > 2008/4/24 Alexandre Plennevaux <[EMAIL PROTECTED]>: > > I wonder why this doesn't work, either it's a but or a flaw in the >> documentation: >> >> >> >> consider this code: >> >> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " >> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> >> <html> >> <head> >> <style type="text/css"> >> h1 { >> background-color: #FF00FF; >> color: white; >> border: 1px solid red; >> } >> </style> >> <script type="text/javascript" src="../jquery.latest.js"></script> >> <script type="text/javascript"> >> $(document).ready(function(){ >> var mycss = $('h1').css('border'); >> alert("hi : " + mycss ); >> }); >> >> </script> >> </head> >> <body> >> <h1>hello world</h1> >> </body> >> </html> >> ... >> >> >> mycss returns undefined instead of '1px solid red' >> >> >> Unless there is a good reason that i'm unaware of, this seems like a bug >> to me, no ? >> >> Thanks >> >> Alexandre >> > > -- Alexandre Plennevaux LAb[au] http://www.lab-au.com