Using php, I add checkboxes:
<div class="member"><input type="checkbox" name="team-members[]" value="5"></div>
And I can get the id when the checkbox is selected:
$('input[name="team-members[]"]').click(function(){
alert($(this).val());
});
I can add a checkbox to the array via ajax:
<div class="member"><input type="checkbox" name="team-members[]" value="9"></div>
But when I click the dynamically added checkbox - the alert does not fire. There are no js errors in the console. How do I get the id of the new checkbox when it is clicked?