I have looked for a while, but I can\'t find a solution for this. I want the following:
if you use mdb use this code
var visible_modal = $('.modal.show').attr('id'); // modalID or undefined if (visible_modal) { // modal is active $('#' + visible_modal).modal('hide'); // close modal }