0

I am trying to set a variable to be the value of my div border-color property value

errorChartColorError = $('.col__item.error').css('border-color');

This works fine in Chrome but Internet Explorer 11 returns the variable as undefined

When I inspect the element in IE, I can see the border-color property and value

Do I need an IE hack?

2
  • I think you may have to specify a side, e.g. errorChartColorError = $('.col__item.error').css('border-top-color'); Commented Nov 2, 2017 at 15:46
  • where did you apply border property? Commented Nov 2, 2017 at 15:52

1 Answer 1

1

The border-color propriety can have up to four value; this mean you can set a different colour per each border (bottom, left, top, right). Be more specific about which one you want to retrive, so:

$(".col__item.error").css("border-top-color");

or

$(".col__item.error").css("border-left-color");

an so on...

should do the trick

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.