Is it possible to change the border color / style of a SELECT element using CSS in IE 8?

I saw that the situation is very problematic after reading this data:

IE6 / IE7 css border for selected item http://api.jquery.com/css/

However, the situation may have changed from Internet Explorer 8. If so, I expect this piece of code to work in IE8:

$(selectObject).css("border", "1px solid red"); $(selectObject).css("border-style", "dashed"); 

This works the way I expect in Firefox, but not in Internet Explorer 8 . (In IE 8, nothing changes). Therefore, either I forget something, or IE8 is still broken (in the sense indicated in the context above).

If I forgot something for IE8, then what is it?

If IE8 is definitely broken and cannot use CSS to change the properties of SELECT elements, do you have any authoritative source that explains this situation? (Along with the possible work around?)

+4
source share
2 answers

What you worked in IE8, you can see the test here: http://jsfiddle.net/G7ThX/

Are you sure your page is not in quirks mode?

As for alternatives, there are jQuery routes to replace the <select> all-together rendering for UI purposes like Stylish Select Box ( last code here ), this is a bit more stylish and perhaps a better route if you want to do more than border and make the same cross browser.

Most of these plugins work by hiding <select> and using its parameters, but still setting its value in the background ... the form does not know the difference in the placed values, so it’s easy to insert it.

+1
source

Source: https://habr.com/ru/post/1313633/


All Articles