How to close the bootstrap modal?

Asked

Viewed 104 times

-1

I need to close one modal by clicking on submit.

He registers objects via Javascript and therefore does not refresh on the page. So far so good. The problem is that the modal doesn’t close...

I did:

var janela = document.getElementById('cadastroCliente');
janela.remove();

But at the end of the operation, despite closing the modal, the screen gets locked...

Modal statement:

<div class="modal fade" id="cadastroCliente" tabindex="-1" role="dialog" aria-labelledby="cadastroClienteLabel" aria-hidden="true">

I tried, too, like this:

janela.style.display = "none";

Unsuccessfully... Both commands close the modal, but does not unlock the rear screen...

1 answer

0

$("#cadastroCliente .close").click();

Just call the close button... I managed to resolve!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.