I have to destroy the modal right after it is closed through a button click, and so I came up with the following.
$("#closeModal").click(function() {
$("#modal").modal('hide').on('hidden.bs.modal', function () {
$("#modal").remove();
});
});
Note that this works with Bootstrap 3.