How might I get an element's border color value using jQuery?
$("#id").css("background-color") to retrieve an element's background color (or most other CSS attributes) works just fine, but
$("#id").css("border-color") returns an empty string.
How can I get the border color value used on the element?
CSS has "short-hand" properties that allows you to send multiple properties at once. Like
background, etc. Well, the
border-color CSS property actually sets the 4 properties
If you want to get the border-color, you need to specify which side. For instance, to obtain the current value of
border-left-color, you'd do:
This should work just fine since it seems as you're expecting that every side has the same color.