I basically have a button to delete something and the code is:
$(document).on('click','.btn',function(){
    //code here
    //$t is the item to delete
    $t.remove();
});
now I would like to execute the following code after the remove or on has finished:
if($('#bookmarks').is(':empty')){
    $('#bookmarks').css('visibility','hidden');
}
I tried adding this into the .on:
$t.on("remove", function () {
    if($('#bookmarks').is(':empty')){
        $('#bookmarks').css('visibility','hidden');
    }   
});
but that didn't work. So how can I execute that function after the item has fully been deleted?
 
     
    