title: Jquery add and remove disable attribute
body: <p>I'm having some checkboxes and text inputs. The Text inputs are disabled when the pages loads. If a checkbox is checked, the corresponding input should be fillable. Here's my current code</p>
  
  <p>For some reason I can't seem to get it right, I'm pretty new to JS and Jquery.
  When I click the checkboxes, nothing happens, and when I load the page I get 6 times the text "false"</p>
  
  <pre><code>    var c1 = $('#check1');
      var c2 = $('#check2');
      var c3 = $('#check3');
  
      var f1 = $('#field1');
      var f2 = $('#field2');
      var f3 = $('#field3');
  
      $(function() {
          enable_cb(c1, f1);
          enable_cb(c2, f2);
          enable_cb(c3, f3);
  
          c1.click(enable_cb(c1, f1));
          c2.click(enable_cb(c2, f2));
          c3.click(enable_cb(c3, f3));
      });
  
  
      function enable_cb(checkbox, field) {
          if (checkbox.checked) {
              console.log('if');
              field.removeAttr("disabled");
          } else {
              console.log('else');
              field.attr("disabled", true);
          }
      }
  </code></pre>
  
  <p>Here's a piece of html, the other parts look the same as this one:</p>
  
  <pre><code>&lt;div class="form-group" &gt;
      &lt;label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect customcheckbox" for="check1"&gt;
          {{ Form::checkbox('check', 1, null, ['class' =&gt; 'mdl-checkbox__input', 'id' =&gt; 'check1']) }}
          &lt;span class="mdl-checkbox__label"&gt;test&lt;/span&gt;
      &lt;/label&gt;
  &lt;/div&gt;
  &lt;div class="form-group" &gt;
      &lt;label for="field1"&gt;test&lt;br&gt;&lt;/label&gt;
      &lt;select id="field1" name="field1" disabled class="searchselect searchselectstyle"&gt;
      &lt;/select&gt;
      @if ($errors-&gt;has('field1'))
          &lt;span class="help-block"&gt;
              &lt;strong&gt;{{ $errors-&gt;first('field1') }}&lt;/strong&gt;
          &lt;/span&gt;
      @endif
  &lt;/div&gt;
  </code></pre>