I have this code to style a checkbox using the iCheck plugin for jquery, is there a way to change the 'insert' attribute later?. I tried recreating the iCheck but the callback function is deleted if I do it that way.
$(this).iCheck({
checkboxClass: checkboxClass,
insert: '<div class="icheck_line-icon"></div>' + $(this).attr("data-label")
});
$(this).on({ifChecked: function(){
iCheckChange(this, yes);
},ifUnchecked: function(){
iCheckChange(this, no);
}
});
Lets say you have checkboxes in this format:
Than you can change your icon and text this way:
Take a look at this Fiddle.