What I'm trying to do with the following snippet should be self-explanatory
<tbody id="slide-table-body">
</tbody>
</table>
<button class="wp-core-ui button-primary" type="button" onclick="addAnotherSlide()">Add another carousel item</button>
<script type="text/javascript">
var newRowHtml = '<tr><td>(assetprevurl)</td><td>(asseturl)</td><td><button type="button" class="wp-core-ui button-primary deleteSlideButton">Delete Slide</button></td></tr>';
function addAnotherSlide() { jQuery('#slide-table-body').append(newRowHtml); }
jQuery(function($){
$('.deleteSlideButton').click(function() { $(this).closest('tr').remove();});
</script>
My problem is that
$('.deleteSlideButton').click(function() { $(this).closest('tr').remove();} );
isn't deleting the row and I can't figure out why.