jQuery if checkbox is checked
checkbox, if-statement, jquery
Solution
if ($('input.checkbox_check').is(':checked')) {
Problem
I have a function below that I want to trigger only when a checkbox in the same `tr` is checked. ``` $(".add_menu_item_table").live('click', function() { if ($('input.checkbox_check').attr(':checked')); { // I want this to trigger. } }); ``` ``` <table id="table-data"> <tbody> <tr> <td><input type="checkbox" class="checkbox_check"></td> <td><input type="button" class="add_menu_item_table" value="Add"></td> </tr> <tr> <td><input type="checkbox" class="checkbox_check"></td> <td><input type="button" class="add_menu_item_table" value="Add"></td> </tr> </tbody> </table> ```