const deleteParent = function(){ $(this).closest('div.tile').remove(); } $('#test1').click(deleteParent);