jquery know if modal is shown code example
Example 1: check if modal hide jquery
alert($('#registration-exams-modal').hasClass('show'));
Example 2: jquery works until modal is shown
$(document).on('show.bs.modal', '#reservationModal', function (e) {
console.log('works');
});