Leveraging jQuery.css for retrieving values in Internet Explorer

I need to assign a variable to the value of the border-color property of my div

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

Although this code works fine in Chrome, Internet Explorer 11 returns it as undefined

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

Is there any specific hack needed for IE?

Answer №1

To customize the border-color property, you can specify up to four values for each border (bottom, left, top, right). If you want to retrieve a specific color, use one of the following:

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

or

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

and so forth...

This should help you achieve the desired result.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When a specific condition is met, Jquery can automatically execute a function contained

I am trying to slowly reveal the h1 tag using jQuery for demonstration purposes. The scroll function is working when I manually click to initiate it, but I am having trouble triggering it automatically. I feel like I might be missing something simple and ...

Confirm if the username is present in jQuery PHP

I am currently working on a functionality to verify if a username is already registered in my application using jQuery, Ajax, and POST method. HTML <div class="form-group"> <label for="username" class="col-md-3 control-label">Username< ...

Issue with jQuery fadeTo() not working after appendTo() function completes

I am facing a problem with the code below that is meant to create a carousel effect for my website. The main issue I am encountering is that the original fadeTo() function does not actually fade the elements, but rather waits for the fade time to finish an ...

Remove outdated choices from subcategory menu upon JSON data retrieval

By using the onchange event in the parent dropdown (first dropdown), I am populating the child dropdown (second dropdown). Subsequently, upon selecting an option from the child dropdown, I automatically fill in three text boxes. However, I am facing an iss ...

What is the process to replace the image in these templates?

I recently downloaded a template from the internet and am in the process of developing a website. Can someone please guide me on how to change the icons highlighted in the black and red boxes as shown in the image? I am using Visual Studio and ASP.NET fo ...

Widen Textbox Sideways

I recently came across a JQuery plugin that caught my eye: https://github.com/rotundasoftware/jquery.autogrow-textarea After following the provided guide, I found myself stuck without any results. I attempted to implement it within my document.ready() $( ...

Tap on the child to reveal their parent

I am working with a family tree that includes dropdown menus containing the names of parents and children. Each child has a link, and when I click on a child's link, I want their father to be displayed in the dropdown menu as the selected option. Can ...

What is preventing the input box from shrinking further?

I created a search box using CSS grid that is supposed to shrink when the page is resized. However, it doesn't seem to shrink as much as I expected it to. Here is how it appears when fully extended: https://i.stack.imgur.com/tPuCg.png And here is how ...

Creating the perfect layout with CSS: A step-by-step guide

As I work on refining my layout to achieve the desired look, let me share my initial idea before delving into the issue at hand. Currently, I am attempting to create something similar to this: https://i.stack.imgur.com/rtXwm.png This is how it appears a ...

ejs-lineargauge major divisions and minor divisions centered

I've been trying to align majorTicks and minorTicks in the middle of the axis, but so far I haven't found a solution despite searching and googling extensively. Here's a snippet of my code: majorTicks: { height: 12, interval: 1, width ...

Applying CSS to text before using jQuery for formatting

Currently, I am utilizing jQuery.before to insert text into my web application using JavaScript. The text is appearing on the screen, however, it is not being styled according to the CSS rules specified in the HTML file. Is there a way to ensure that jQu ...

A concealed Cytoscape chart will not be able to show up at a later time

There are two Bootstrap columns on my webpage, each with a width of 6 out of 12. The left column contains buttons, while the right column holds a Cytoscape graph initialized with 5 nodes. Upon page load completion, the Cytoscape graph is initially set to ...

verifying if checkbox is selected using a while loop in PHP

Help Needed: I am currently trying to loop through some code, but I'm struggling with checking checkboxes using PHP. Could someone please review my code and provide guidance on what needs to be added? Any assistance would be greatly appreciated. Thank ...

Enhancing collapsible list headers in jquery mobile with checkboxes

Having trouble with a jQuery Mobile website issue. Currently working on a jQuery mobile site that includes a collapsible list (). The client request is to have a checkbox inside the header, allowing users to check items off without needing to open them. T ...

What could be causing the whitespace around this element when using SASS from Refills / Bourbon.io?

I've recently started using the impressive SASS framework, Boubon.io created by the talented team at thoughtbot. As I experiment with their supplied templates (known as Refills), I'm finding that Bourbon.io serves as a versatile alternative to po ...

Enhancing the appearance of each letter within a word

I am currently working on styling the word "Siteripe". Each letter should have a different color, just like it is shown on this website. I have successfully styled only the first letter using the following CSS code: #namer:first-letter { color:#09C; f ...

Customizing Sass Bootstrap Variables for Tailored Responsive Designs (Specifically for Mobile or Desktop)

Currently, I am in the process of working on a website that has opted for the adaptive approach, using separate mobile and desktop templates instead of responsive design. Despite this choice, Bootstrap is still being utilized on these templates, loading al ...

"Enhancing visual effects with personalized animations in Highcharts using setSeries or setCategories

I successfully created a customized highchart graph with 3 added buttons. An example can be viewed here: http://jsfiddle.net/eszwd420/ $(function () { var averageLabel =[1278302400000, 1286251200000, 1294203600000, 1301976000000, 13098384000 ...

show button after the page has finished loading

I have a button similar to this: <input type="submit" id="product_197_submit_button" class="wpsc_buy_button" name="Buy" value="Add To Cart"> However, I am encountering an issue where if the user clicks the button before all scripts are loaded, an e ...

Obtain the button's name value using Jquery

I currently have a button set up in the following manner: <button class="language-select selected" type="button" name="en-gb"></button> Does anyone know how I can retrieve the value "en-gb" from the name attribute using jQuery? My ultimate go ...