0

How can I add !important css attribute with jQuery to after the "border-left-color",'#'+hex ?

$(document).ready(function($){
           $('.gkColorPicker').colpick({
           layout:'full',
           colorScheme:'light',
           onChange:function(hsb,hex,rgb,fromSetColor) {
           if(!fromSetColor) $('.gkColorPicker').val(hex).css("border-left-color",'#'+hex);
           },
           onSubmit:function(hsb,hex,rgb,el) {
          $('.gkColorPicker').colpickHide();
          }
         });
          $('.gkColorPicker').keyup(function(){
         $(this).colpickSetColor(this.value);
   });
});

I appreciate any help. Thank you.

j_monroe
  • 82
  • 1
  • 8
  • 5
    Don’t use `!important`; fix the rest of your CSS instead. – Ry- Oct 29 '13 at 19:15
  • 1
    If the answer is to use `!important`, you're asking the wrong question. – j08691 Oct 29 '13 at 19:16
  • Beat me to it @minitech. – dowomenfart Oct 29 '13 at 19:16
  • 5
    You shouldn't need to add `!important` since `.css` adds inline styles which have the highest specificity already. Unless you are trying to override another rule already using `!important`, which gives you a good reason why you shouldn't have used it to begin with. – James Montagne Oct 29 '13 at 19:18

1 Answers1

-2

Did u try sth like that:

$('.gkColorPicker').css("border-left-color",'#'+hex+' !important');
BordiArt
  • 756
  • 8
  • 20