How to make border-color

After select item i want to make border color green
I use but it does not work.
What is right way to solve this task?
PS: I am trying to show error/success after saving
Thanks a lot!
$(’.transactionBind’).on(‘select2:select’, function(e) {
$(this).css(‘border-color’, ‘red’);

Is someone know how to solve it?

The reason this doesn’t work is that you’re setting the border color on the HTML <select> element, rather than on the Select2 widget’s HTML elements. The Select2 widget is created from <span>s, <ul>s, and other HTML elements in order to create the custom widget display. Those HTML elements are not documented anywhere, but you can discover them by using your browser’s Element Inspector. You should see that Select2 normally inserts the Select2 widget container directly after the underlying HTML <select> element that you specified when you initialized the Select2 widget. The widget container is a <span> with classes of “select2” and “select2-container”. That should give you enough information to find the element whose border CSS you need to set. (Note that you will need to set not just the border color, but also the border width and style.)