title: Enable/Disable Delete Button with Javascript
body: <p>I am having an issue with Enabling a button with a checkbox using JavaScript. Whenever I click the checkbox, the Delete button stays disabled.</p>
  
  <p>The code I am using is as follows:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $('#cb_delete').click(function(){
  
      if($(this).attr('checked') == false){
           $('#btn-delete').attr("disabled","disabled");   
      }
      else {
          $('#btn-delete').removeAttr('disabled');
      }
  });
  
  &lt;/script&gt;
  
  &lt;button type='submit' name='btn-delete' disabled='disabled' id='btn-delete' class='btn btn-default btn-sm'&gt;Delete&lt;/button&gt; 
  &lt;td&gt;&lt;input type='checkbox' name='cb_delete[]' id='cb_delete' value='$mID'&gt;&lt;/td&gt;
  </code></pre>