Get border color with jQuery in IE with .css()
border, css, internet-explorer, jquery
Solution
Try this ..Works on IE8
$("#clickme").click(function() {
$('body').append($(this).css('border-top-color'));
});
jsFiddle
Also, Colors are returned by browsers in a different way FireFox, Safari and Chrome return them as `rgb()` values and `IE` returns them exactly like you set them in your `CSS` even when you use the shorthand notation (`#f00` vs `#ff0000`) and Opera always returns the color as `hexidecimal` with 6 digits
Problem
There is a problem getting border color of the clicked element in Internet Explorer. ``` $("#clickme").click(function() { alert($(this).css('border-color')); }); ``` Here is jsfiddle: http://jsfiddle.net/dS7mc/ It works in chrome but it doesn't work in IE10. Any ideas how to make it work with both? Also changing to "border" only, in chrome it gives me `2px solid rgb(0, 0, 0)` but in Ie i still get empty alert. PS. Yes, I've tried "borderColor". Also doesn't work in IE