title: Just want checkbox value to pass to jquery variable
body: <p>Input </p>
  
  <pre><code>&lt;input type='checkbox' id='checkbox_to_update' name='checkbox_to_update' value='1'&gt;
  </code></pre>
  
  <p>Want to pass value to jquery variable</p>
  
  <p>Checkbox is checked</p>
  
  <p>Tried <code>var checkbox_to_update = $("input[name='checkbox_to_update']");</code></p>
  
  <p>With alert get <code>[object Object]</code></p>
  
  <p>Then tried <code>var checkbox_to_update = $("#id").attr("checkbox_to_update");</code></p>
  
  <p>With alert get <code>undefined</code></p>
  
  <p>What is correct code for `var checkbox_to_update ='</p>