iCheck and manual setting of checkbox to checked
<p>I'm using the <a href="https://github.com/fronteed/icheck" rel="noreferrer">iCheck framework</a> and I have two inputs</p>

<pre><code>&lt;input name="group" id="id1" type="radio" checked&gt;
&lt;input name="group" id="id2" type="radio"&gt;
&lt;input name="group" id="id3" type="radio"&gt;
&lt;input name="group" id="id4" type="radio"&gt;
</code></pre>

<p>On click I call an ajax function. If something fail, I want to set back the checked attribute to the previously selected input.</p>

<pre><code>var currentChecked = $("input[name='group']:radio:checked");

$("input[name='group']:radio").each(function() {
        $(this).on('ifChecked', function(){
               $.ajax({
                    url: "/ajax/something/"
                })
                .done(function (data) {
                    currentChecked = $(this);
                })
                .fail(function (data) {
                    $(this).removeAttr('checked');
                    currentChecked.prop('checked', true);
                });
 });
});
</code></pre>

<p>But this will not reset the checked checkbox. There is something I don't see from the iCheck framework? Any solution?</p>