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