I have bootstrap modal popup, in footer of modal popup there is one button
<button type="button" class="btn btn-primary submit">Submit</button>
when i click this button a confirmation is opened
$(".submit").on("click",function(event){
event.preventDefault();
if(confirm('Please confirm?')) {
$(".submit").removeClass('submit');
$(this).addClass('close_popup');
} else {
}
});
$(document).on('click','.close_popup',function(){
$('#default_modal').modal('hide');
});
i want if i click on submit button for the first time submit class should get removed and close_popup class should be added and on clicking for second time on close_popup class the modal should get closed. In my case confirmation popup is open and if i click on ok the modal is also getting closed.
Any Solution to fix this issue Thanks