I\'ve a checkbox that enable or disable a select element
Actually I use this simple piece of code that works fine.
$(\"#filtri\").change(function(){
You can write your own plugin that does something like this.
Add this after jQuery, in a script file preferably.
(function($) {
$.fn.toggleDisabled = function(){
return this.each(function(){
this.disabled = !this.disabled;
});
};
})(jQuery);
Then use it like this:
$('#my-select').toggleDisabled();
Courtesy: Toggle input disabled attribute using jQuery